Amur.Router (amur v0.3.4)

Copy Markdown

Plug router for the Amur OAuth flow.

Mount it under your router, for example with forward "/auth", Amur.Router (in Phoenix, inside a browser pipeline and with alias: false). It exposes, relative to the mount point:

  • GET /auth/:provider - start the OAuth flow
  • GET /auth/:provider/callback - handle the provider callback

Summary

Functions

Fetches request state and dispatches the supported OAuth routes.

Initializes the router with the options supplied by Plug.

Functions

call(conn, opts)

Fetches request state and dispatches the supported OAuth routes.

Query parameters and the session are fetched before dispatch so the controller can build authorization requests and validate callbacks. Unknown methods or paths pass through unchanged.

init(opts)

Initializes the router with the options supplied by Plug.

Amur does not currently require router options, so they are returned unchanged for Plug's supervision and compilation conventions.