Skip to content

Route Handler Configurations

litestar_users.config.AuthHandlerConfig dataclass

Configuration for user authentication route handlers.

Passing an instance to LitestarUsersConfig will automatically take care of handler registration on the app.

login_path class-attribute instance-attribute

login_path = '/login'

The path for the user authentication/login route.

logout_path class-attribute instance-attribute

logout_path = '/logout'

The path for the logout route.

tags class-attribute instance-attribute

tags = None

A list of string tags to append to the schema of the route handler(s).

litestar_users.config.CurrentUserHandlerConfig dataclass

Configuration for the current-user route handler.

Passing an instance to LitestarUsersConfig will automatically take care of handler registration on the app.

path class-attribute instance-attribute

path = '/users/me'

The path to get or update the currently logged-in user.

tags class-attribute instance-attribute

tags = None

A list of string tags to append to the schema of the route handler(s).

litestar_users.config.PasswordResetHandlerConfig dataclass

Configuration for the forgot-password and reset-password route handlers.

Passing an instance to LitestarUsersConfig will automatically take care of handler registration on the app.

forgot_path class-attribute instance-attribute

forgot_path = '/forgot-password'

The path for the forgot-password route.

reset_path class-attribute instance-attribute

reset_path = '/reset-password'

The path for the reset-password route.

tags class-attribute instance-attribute

tags = None

A list of string tags to append to the schema of the route handler(s).

litestar_users.config.RegisterHandlerConfig dataclass

Configuration for the user registration route handler.

Passing an instance to LitestarUsersConfig will automatically take care of handler registration on the app.

path class-attribute instance-attribute

path = '/register'

The path for the registration/signup route.

tags class-attribute instance-attribute

tags = None

A list of string tags to append to the schema of the route handler(s).

litestar_users.config.RoleManagementHandlerConfig dataclass

Configuration for the role management route handlers.

Passing an instance to LitestarUsersConfig will automatically take care of handler registration on the app.

path_prefix class-attribute instance-attribute

path_prefix = '/users/roles'

The prefix for the router path.

assign_role_path class-attribute instance-attribute

assign_role_path = '/assign'

The path for the role assignment router.

revoke_role_path class-attribute instance-attribute

revoke_role_path = '/revoke'

The path for the role revokement router.

guards class-attribute instance-attribute

guards = field(default_factory=list)

A list of callable [Guards][litestar.types.Guard] that determines who is authorized to manage roles.

tags class-attribute instance-attribute

tags = None

A list of string tags to append to the schema of the route handler(s).

litestar_users.config.UserManagementHandlerConfig dataclass

Configuration for user management (read, update, delete) route handlers.

Passing an instance to LitestarUsersConfig will automatically take care of handler registration on the app.

Note: - These routes make use of Litestar Guards to require authorization. Callers require admin or similar privileges.

path_prefix class-attribute instance-attribute

path_prefix = '/users'

The prefix for the router path.

By default, the path will be suffixed with '/{user_id:<type>}'.

guards class-attribute instance-attribute

guards = field(default_factory=list)

A list of callable [Guards][litestar.types.Guard] that determines who is authorized to manage other users.

tags class-attribute instance-attribute

tags = None

A list of string tags to append to the schema of the route handler(s).

litestar_users.config.VerificationHandlerConfig dataclass

Configuration for the user verification route handler.

Passing an instance to LitestarUsersConfig will automatically take care of handler registration on the app.

path class-attribute instance-attribute

path = '/verify'

The path for the verification route.

tags class-attribute instance-attribute

tags = None

A list of string tags to append to the schema of the route handler(s).