Skip to main content
POST
Validate an existing session token and return the user object
Validate an existing session token and return the user object. Protected route that returns the user object from the request body when the session is valid. Requires authentication and appropriate role middleware.

Request

Headers

Request Body

Request Body Schema

Response

200 OK - Session valid

Returns the user object.

401 Unauthorized

500 Internal Server Error

Example

Notes

  • This endpoint requires a valid JWT token in the Authorization header
  • The request body should contain the user object you want to validate
  • This is useful for checking if a session is still active and valid
  • The endpoint validates both the token and the user object in the request body
  • Use this to implement session refresh logic in your application

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
user
object

Response

Session valid — returns the user

data
object