mirror of
https://github.com/team-alembic/ash_authentication.git
synced 2024-09-20 13:24:20 +12:00
1c8f138c67
Highlights: * Replaced `AshAuthentication.Provider` with the much more flexible `AshAuthentication.Strategy`. * Moved strategies to within the `authentication` DSL using entities and removed excess extensions. * Added a lot more documentation and test coverage.
26 lines
472 B
Elixir
26 lines
472 B
Elixir
defmodule DevServer.GqlRouter do
|
|
@moduledoc """
|
|
Router for GraphQL requests.
|
|
"""
|
|
use Plug.Router
|
|
import Example.AuthPlug
|
|
|
|
plug(:load_from_bearer)
|
|
plug(:set_actor, :user)
|
|
plug(AshGraphql.Plug)
|
|
plug(:match)
|
|
plug(:dispatch)
|
|
|
|
forward("/playground",
|
|
to: Absinthe.Plug.GraphiQL,
|
|
init_opts: [
|
|
schema: Example.Schema,
|
|
interface: :playground
|
|
]
|
|
)
|
|
|
|
forward("/",
|
|
to: Absinthe.Plug,
|
|
init_opts: [schema: Example.Schema]
|
|
)
|
|
end
|