Access Controllers

User Access and Authentication Endpoints.

Handles user registration, login (JWT token issuance via cookies), token refreshing, logout, and user-specific profile actions.

async signup(users_service: app.domain.users.services.UserService, account_register: AccountRegister) MsgSpecJSONResponse[source]

User Signup.

Returns:

The newly registered user data.

Return type:

User

Raises:

ConflictException – If a user with this email already exists.

async signin(users_service: app.domain.users.services.UserService) Response[source]

Issue access and refresh tokens. Store tokens in cookies.

Returns:

HTTP 204 No Content response with access and refresh tokens set as cookies.

Return type:

Response

Raises:

UnauthorizedException – If authentication fails (handled by dependencies).

async user_auth_refresh_token(background_tasks: BackgroundTasks, user_auth: app.domain.users.schemas.UserAuth) Response[source]

Get the user by the refresh token and issue a new access token.

The expired refresh token is added to the blacklist as a background task.

Returns:

HTTP 204 No Content response with new access and refresh tokens.

Return type:

Response

async logout(background_tasks: BackgroundTasks, user_auth: app.domain.users.schemas.UserAuth) Response[source]

User Logout.

Deletes access and refresh tokens from cookies and invalidates the refresh token JTI in cache as a background task.

Returns:

HTTP 204 No Content response.

Return type:

Response

async update_password(background_tasks: BackgroundTasks, users_service: app.domain.users.services.UserService, pwd_data: PasswordUpdate) Response[source]

Update user password.

This action also invalidates the user’s authentication cache and deletes access and refresh tokens from cookies.

Returns:

HTTP 204 No Content response.

Return type:

Response

async user_auth_get_self_info(user_auth: app.domain.users.schemas.UserAuth) MsgSpecJSONResponse[source]

Get self account info.

Returns:

The authenticated user’s details data.

Return type:

UserAuth