curl --request GET \
--url https://api.example.com/api/verify-token{
"error": "No token provided, authorization denied"
}
Verify the validity of a JWT token and retrieve user information
curl --request GET \
--url https://api.example.com/api/verify-token{
"error": "No token provided, authorization denied"
}
Authorization: Bearer <token>
x-auth-token: <token>
curl -X GET https://api.meetmates.com/api/verify-token \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
curl -X GET https://api.meetmates.com/api/verify-token \
-H "x-auth-token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
{
"success": true,
"message": "Token is valid",
"user": {
"id": "657f4d8e90c23a4567b38f91",
"email": "[email protected]",
"name": "John Doe"
}
}
{
"error": "No token provided, authorization denied"
}
Authorization: Bearer <token> header or x-auth-token header