Expand description
Authentication-related route handlers Handles user signup, login, account deletion, data retrieval, token refresh, and logout.
Structsยง
Functionsยง
- delete_
account - Handles user account deletion requests
- extract_
user_ ๐id - Extracts the user ID as a string from the User struct
- get_
user_ data - Handles user data retrieval requests
- login
- Handles user login requests
- logout
- Handles user logout requests This endpoint allows clients to log out by revoking the provided refresh token. It removes the refresh token from the database, effectively invalidating it and preventing any further use for obtaining new access tokens.
- refresh_
token - Handles token refresh requests This endpoint allows clients to obtain a new access token using a valid refresh token. It verifies the refresh token, checks its validity in the database, and generates a new access token if everything is valid. The refresh token is not rotated in this implementation, but it can be easily modified to do so if desired.
- signup
- Handles user signup requests
- update_
user_ profile - Handles user profile update requests This endpoint allows clients to update their user profile information, such as username and email. It verifies the provided data, updates the user profile in the database, and logs the operation.
- verify_
user_ ๐credentials - Verifies user credentials (username/email and password) against the database