oauth/oidc

This commit is contained in:
bluepython508
2023-11-07 19:35:03 +00:00
parent a0fc306df1
commit 54db8727b0
20 changed files with 670 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ defmodule SsoBsn.Accounts.User do
schema "users" do
field :username, :string
field :confirmed_at, :naive_datetime
field :last_login_at, :utc_datetime_usec
has_many :keys, UserKey
@@ -57,4 +58,8 @@ defmodule SsoBsn.Accounts.User do
user
|> Ecto.build_assoc(:keys)
end
def login_changeset(user) do
change(user, last_login_at: DateTime.utc_now())
end
end