mirror of
https://github.com/team-alembic/ash_authentication.git
synced 2024-09-20 13:24:20 +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.
24 lines
597 B
Elixir
24 lines
597 B
Elixir
defmodule DevServer do
|
|
@moduledoc """
|
|
This module provides an extremely simplified authentication UI, mainly for
|
|
local development and testing.
|
|
"""
|
|
|
|
use Supervisor
|
|
|
|
def start_link(init_arg), do: Supervisor.start_link(__MODULE__, init_arg, name: __MODULE__)
|
|
|
|
@impl true
|
|
def init(_init_arg) do
|
|
opts =
|
|
:ash_authentication
|
|
|> Application.get_env(DevServer, [])
|
|
|> Keyword.delete(:start?)
|
|
|
|
[
|
|
{DevServer.Session, []},
|
|
{Plug.Cowboy, scheme: :http, plug: DevServer.Router, options: opts}
|
|
]
|
|
|> Supervisor.init(strategy: :one_for_all)
|
|
end
|
|
end
|