Imison.Web.SessionController (Imison v0.1.0)

Copy Markdown View Source

Signs in to the dashboard and out of it, at <path>/login and <path>/logout of a dashboard mounted with Imison.Web.Router.imison_dashboard/2.

A plain controller rather than a LiveView, because only a plain request can write the host's session cookie. The route's private :imison_name and :imison_dashboard_path, set by the router, name the instance whose login is checked and the dashboard to return to.

Repeated failed sign-ins are slowed down: while a wait is running, or when the failed sign-ins can't be read, a sign-in is refused before its credentials are checked.

Summary

Functions

create(conn, params)

@spec create(Plug.Conn.t(), map()) :: Plug.Conn.t()

delete(conn, params)

@spec delete(Plug.Conn.t(), map()) :: Plug.Conn.t()

new(conn, params)

@spec new(Plug.Conn.t(), map()) :: Plug.Conn.t()