HaAuth.Router (ha_auth v0.1.0)

Copy Markdown View Source

Routes for the login page and sign-in, added to a Phoenix router with

import HaAuth.Router

# at the top level of the router, not inside a scope:
ha_auth_routes()

Options:

  • :pipe_through - the app's browser pipelines (default [:browser]); they need :fetch_session, flash and CSRF protection
  • :root_layout - root layout for the login and phone pages, e.g. {MyAppWeb.Layouts, :root} (default: whatever the pipelines set). It must load the app's app.js so the login page's LiveView connects.

Adds GET /login, /auth/ha, /auth/callback, /auth/kiosk, /auth/pair/finish, GET/POST /pair/:code and DELETE /logout.

Summary

Functions

ha_auth_routes(opts \\ [])

(macro)