SyntropyWeb.OperatorAuth
(syntropy v0.2.0)
Copy Markdown
Session-based operator authentication for the mission control UI.
Credentials come from the environment (SYNTROPY_OPERATOR_PASSWORD, plus
an optional SYNTROPY_OPERATOR_USER, default "operator"). Enforcement is
required outside dev/test, mirroring SyntropyWeb.ApiAuth.required?/0.
Summary
Functions
LiveView mount guard: live_session ..., on_mount: {SyntropyWeb.OperatorAuth, :default}.
Validates a login attempt in constant time.
Functions
@spec authenticated?(Plug.Conn.t() | map()) :: boolean()
@spec on_mount(:default, map(), map(), Phoenix.LiveView.Socket.t()) :: {:cont, Phoenix.LiveView.Socket.t()} | {:halt, Phoenix.LiveView.Socket.t()}
LiveView mount guard: live_session ..., on_mount: {SyntropyWeb.OperatorAuth, :default}.
@spec required?() :: boolean()
@spec session_key() :: String.t()
@spec sign_in(Plug.Conn.t()) :: Plug.Conn.t()
@spec sign_out(Plug.Conn.t()) :: Plug.Conn.t()
@spec username() :: String.t()
Validates a login attempt in constant time.