ash_authentication/dev/dev_server.ex
James Harton a939dde9b9
feat(PasswordAuthentication): Registration and authentication with local credentials (#4)
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.
2022-10-25 11:07:07 +13:00

24 lines
595 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.Plug, options: opts}
]
|> Supervisor.init(strategy: :one_for_all)
end
end