mirror of
https://github.com/team-alembic/ash_authentication.git
synced 2024-09-20 13:24:20 +12:00
a939dde9b9
This is missing a bunch of features that you probably want to use (eg confirmation, password resets), but it's a pretty good place to put a stake in the sand and say it works.
24 lines
424 B
Elixir
24 lines
424 B
Elixir
defmodule Example.TokenRevocation do
|
|
@moduledoc false
|
|
use Ash.Resource,
|
|
data_layer: AshPostgres.DataLayer,
|
|
extensions: [AshAuthentication.TokenRevocation]
|
|
|
|
@type t :: %__MODULE__{
|
|
jti: String.t(),
|
|
expires_at: DateTime.t()
|
|
}
|
|
|
|
actions do
|
|
destroy :expire
|
|
end
|
|
|
|
postgres do
|
|
table("token_revocations")
|
|
repo(Example.Repo)
|
|
end
|
|
|
|
revocation do
|
|
api Example
|
|
end
|
|
end
|