Get Current User
Users
Get Current User
Retrieves the currently authenticated user information
GET
Get Current User
Overview
This endpoint returns the profile information of the currently authenticated user. It requires a valid authentication session with theaccessToken cookie.
This endpoint requires authentication. You must be logged in with a valid access token cookie.
Authentication
This endpoint uses cookie-based authentication and requires:deserializeTokenmiddleware - Extracts and verifies the JWT token from theaccessTokencookierequiredLoginmiddleware - Ensures the user is authenticated before accessing the endpoint
Request
No request body or query parameters are required. The user information is extracted from the authenticated session.Response
Response status. Always returns
"success" for successful requests.Contains the user data object.
Examples
Request
Response
Error Responses
| Status Code | Description |
|---|---|
| 401 | User is not authenticated. Access token is missing or expired. |
| 400 | Invalid or malformed access token. |
Implementation Details
From the handler implementation (src/user/handler.ts:6): The endpoint retrieves user data fromres.locals.user, which is populated by the deserializeToken middleware after successfully validating the JWT token from the accessToken cookie.
Related Endpoints
- Register - Create a new account and receive authentication cookies
- Login - Login to an existing account
- Refresh Token - Renew your access token