Raxol.Auth.Plug (Raxol v0.5.0)

View Source

Plug for handling authentication and authorization.

Summary

Functions

authenticate_user(conn, email, password)

Authenticates a user by email and password.

call(conn, opts)

init(opts)

is_admin?(conn)

(macro)

logout_user(conn)

Logs out the current user.

require_authenticated_user(conn, opts)

Checks if the current user is logged in.

require_permission(conn, module, action)

@spec require_permission(
  Plug.Conn.t(),
  atom() | [atom()],
  atom() | [atom()]
) :: Plug.Conn.t()