Skip to main content
Verify if the current session is authenticated and retrieve user information.

Request

curl https://fucksornot.com/api/auth/check \
  -H "Cookie: auth-token=YOUR_JWT_TOKEN"

Response

Authenticated User

{
  "authenticated": true,
  "userId": "550e8400-e29b-41d4-a716-446655440000",
  "isAdmin": false,
  "mfaEnabled": true,
  "user": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "username": "johndoe",
    "email": "user@example.com"
  }
}

Not Authenticated

If there is no valid auth-token cookie, the endpoint responds with a 401 error:
{
  "statusCode": 401,
  "statusMessage": "Unauthorized",
  "message": "Not authenticated"
}

Use Cases

  • Verify token validity on app startup
  • Check if MFA is enabled for the user
  • Determine admin status for UI display