Skip to main content

Is Admin

GET /api/auth/isAdmin​

Check if the current user is authenticated and has the admin role.

Response​

  • 200 OK

    { "success": true, "isAdmin": true }
    • The user is authenticated and is an admin.
  • 200 OK

    { "success": true, "isAdmin": false }
    • The user is authenticated but is not an admin.
  • 401 Unauthorized

    { "success": false, "isAdmin": false }
    • The user is not authenticated or the token is invalid/expired.

Example​

curl -X GET http://localhost:8080/api/auth/isAdmin \
--cookie "token=your_jwt_token"