RestAuth v2.0.0 RestAuth.ErrorHandler behaviour View Source

Behaviour for providing overridable error handling for RestAuth plugs.

Configured with RestAuth.Configure like:

plug RestAuth.Configure,
  handler: YourHandler,
  error_handler: YourErrorHandler

Link to this section Summary

Functions

Deletes the x-auth-token cookie

Returns the ErrorHandler from the conn, or raises

Callbacks

Triggered when there is an error authenticating a client

Triggered when a client is unauthenticated

Triggered when a client is unauthorized

Link to this section Functions

Link to this function clean_cookie(conn, bool) View Source

Deletes the x-auth-token cookie.

For use when an invalid token is provided by a cookie.

Returns the ErrorHandler from the conn, or raises.

Link to this section Callbacks

Link to this callback cannot_authenticate(conn, reason, from_cookie?) View Source
cannot_authenticate(conn :: Plug.Conn.t, reason :: any, from_cookie? :: boolean) :: Plug.Conn.t

Triggered when there is an error authenticating a client.

Used in: RestAuth.Authenticate.

Link to this callback unauthenticated(conn) View Source
unauthenticated(conn :: Plug.Conn.t) :: Plug.Conn.t

Triggered when a client is unauthenticated.

Used in: RestAuth.Restrict.

Link to this callback unauthorized(conn) View Source
unauthorized(conn :: Plug.Conn.t) :: Plug.Conn.t

Triggered when a client is unauthorized.

Used in: RestAuth.Restrict.