token_revoked
The message text is shown in the example below.
| HTTP status | 401 |
type | authentication_error |
| Retry? | No, not unchanged |
| Status | In the public catalog (error-envelope.ts) |
| Extra fields | none |
When it happens
The person signed out elsewhere, an admin removed the session, or the app called revoke.
Example
{
"error": {
"type": "authentication_error",
"code": "token_revoked",
"message": "This sign-in was revoked. Run `syntic login` again.",
"param": null,
"request_id": "req_6f1c2a9e0b7d4c3a8e5f1b2d"
}
}How to fix it
- Clear stored tokens and send the person through sign-in again.
Detect it in code
err = resp.json().get("error", {})
if resp.status_code == 401 and err.get("code") == "token_revoked":
log.warning("%s (%s)", err["message"], err["request_id"]) # fix the request; do not retry unchangedRelated
Was this page helpful?