Validates a JWT token issued by RegardingWork Hub service and returns user information if valid.
POST https://premium.regardingwork.com/auth/validate
None required
Content-Type: application/json
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..." // Required: JWT token from Hub
}
{
"valid": true,
"user": {
"user_id": 7,
"username": "testhub",
"bio": "Test user profile",
"is_active": true,
"role": "superadmin"
}
}
{
"error": "Token is required"
}
{
"valid": false,
"error": "Invalid or expired token"
}
const response = await fetch('https://premium.regardingwork.com/auth/validate', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
token: 'your_jwt_token_here'
})
});
const result = await response.json();
if (result.valid) {
console.log('User:', result.user);
} else {
console.error('Invalid token');
}
curl -X POST https://premium.regardingwork.com/auth/validate \
-H "Content-Type: application/json" \
-d '{
"token": "your_jwt_token_here"
}'