mirror of
https://github.com/team-alembic/ash_authentication.git
synced 2024-09-21 13:53:25 +12:00
8797005175
* improvement(docs): change all references to `actor` to `user`. The word "actor" has special meaning in the Ash ecosystem. * chore: format `dev` directory also. * feat(Ash.PlugHelpers): Support standard actor configuration. * Adds the `:set_actor` plug which will set the actor to a resource based on the subject name. * Also includes GraphQL and JSON:API interfaces in the devserver for testing.
23 lines
464 B
Elixir
23 lines
464 B
Elixir
defmodule DevServer.ClearSession do
|
|
@moduledoc """
|
|
Resets the session storage, to 'log out" all users.
|
|
"""
|
|
|
|
@behaviour Plug
|
|
alias Plug.Conn
|
|
|
|
@doc false
|
|
@impl true
|
|
@spec init(keyword) :: keyword
|
|
def init(opts), do: opts
|
|
|
|
@doc false
|
|
@impl true
|
|
@spec call(Conn.t(), any) :: Conn.t()
|
|
def call(conn, _opts) do
|
|
conn
|
|
|> Conn.clear_session()
|
|
|> Conn.put_resp_header("location", "/")
|
|
|> Conn.send_resp(302, "Redirected")
|
|
end
|
|
end
|