Skip to main content
GET
/
intern
/
me
Get Current User
curl --request GET \
  --url https://api.example.com/intern/me
{
  "role": "<string>"
}
Returns the role of the currently authenticated employee. This endpoint requires a valid access_token cookie and uses the verifyToken middleware to verify the user’s identity.

Authentication

This endpoint requires JWT authentication via the access_token cookie.

Response

role
string
The role of the authenticated employeePossible values: "Administrador" or "Asistente de Gerencia"

Example Request

curl https://api.example.com/intern/me \
  -b "access_token=your_access_token_here"

Example Responses

201 Success
{
  "role": "Administrador"
}
401 Token Not Sent
{
  "auth": false,
  "message": "Token No Enviado"
}
401 Invalid Token
{
  "auth": false,
  "message": "Token Invalido o Expirado"
}
400 Server Error
{
  "error": "Internal Server Error"
}

Use Cases

  • Verify user permissions before displaying admin UI
  • Check if current user can perform privileged operations
  • Display role-specific navigation or features
This endpoint only verifies the token and returns the role. It does not check for specific role permissions like the signup endpoint does with verifyRol middleware.

Build docs developers (and LLMs) love