Introduce device flow

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2023-02-21 14:50:09 +01:00
parent 2ee329ff7b
commit b6875f6a4b
19 changed files with 833 additions and 47 deletions

View File

@@ -0,0 +1,10 @@
defmodule Mobilizon.Storage.Repo.Migrations.AddDeviceFlowSupport do
use Ecto.Migration
def change do
alter table(:application_tokens) do
add(:status, :string, default: :pending, null: false)
add(:scope, :string)
end
end
end

View File

@@ -0,0 +1,16 @@
defmodule Mobilizon.Repo.Migrations.CreateApplicationDeviceActivation do
use Ecto.Migration
def change do
create table(:application_device_activation) do
add(:user_code, :string)
add(:device_code, :string)
add(:scope, :string)
add(:expires_in, :integer)
add(:status, :string, default: "pending")
add(:user_id, references(:users, on_delete: :delete_all), null: true)
add(:application_id, references(:applications, on_delete: :delete_all), null: false)
timestamps()
end
end
end