Retrieve current user status
GET/api/auth/user
Retrieves current user state, whether someone is logged in or not a 200 result is provided. This is used in the frontend to determine whether certain aspects should be shown.
Request
Responses
- 200
- application/json
- Schema
- Example (auto)
Schema
- oneOf
- AuthenticatedUser
- UnauthenticatedUser
stateobjectrequired
Example:
authenticated
user object
stateobjectrequired
Example:
unauthenticated
{
"state": "authenticated",
"user": {
"sub": "user-id-123",
"name": "John Doe",
"email": "john.doe@example.com",
"roles": [
"admin",
"user"
],
"didId": "did:example:123456789",
"refreshToken": "refresh-token-abc123"
}
}
- curl
- http
- CURL
curl -L 'https://tsg.dataspac.es/api/auth/user' \
-H 'Accept: application/json'