Authentication gate plug that halts unauthenticated requests.
This plug checks for conn.assigns.current_scope. If present, the request
passes through unchanged. If absent (nil), the configured error handler is
called with :unauthenticated and the connection is halted.
Options
:error_handler- Module implementingSigra.Plug.ErrorHandler. Required.
Example
plug Sigra.Plug.RequireAuthenticated,
error_handler: MyAppWeb.AuthErrorHandler
Summary
Functions
Check for authenticated user and halt if not present.
Initialize the plug with the given options.