POST /api/auth/logout
Logs out the current user by clearing the access and refresh token cookies from the client.Authentication
No authentication required (clears cookies regardless of validity).Request Body
No request body required.Response
Success message confirming logout.
Cookies Cleared
accessToken- Removed from clientrefreshToken- Removed from client
Example Request
Example Response
Notes
- This endpoint always returns a success response (status 200)
- No server-side session invalidation occurs (JWT tokens remain valid until expiry)
- The tokens are simply removed from the client’s cookies
- After logout, any existing JWT tokens can still be used if manually provided in requests
- For enhanced security, consider implementing a token blacklist for true server-side invalidation