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.
19 lines
626 B
Elixir
19 lines
626 B
Elixir
defmodule DevServer.Router do
|
|
@moduledoc false
|
|
use Plug.Router
|
|
|
|
plug(Plug.Parsers, parsers: [:urlencoded, :multipart, :json], json_decoder: Jason)
|
|
plug(Plug.Session, store: :ets, key: "_ash_authentication_session", table: DevServer.Session)
|
|
plug(:fetch_session)
|
|
plug(:fetch_query_params)
|
|
plug(Plug.Logger)
|
|
plug(:match)
|
|
plug(:dispatch)
|
|
|
|
forward("/auth", to: Example.AuthPlug)
|
|
get("/clear_session", to: DevServer.ClearSession)
|
|
post("/token_check", to: DevServer.TokenCheck)
|
|
forward("/api", to: DevServer.ApiRouter)
|
|
forward("/gql", to: DevServer.GqlRouter)
|
|
forward("/", to: DevServer.WebRouter)
|
|
end
|