AuthReason
const AuthReason: object;Defined in: src/http/unauthorized.ts:38
The closed set of reason codes a 401 may carry.
Readers must treat an unrecognised code as AuthReason.Unauthorized — that means the server is newer, not broken.
Type Declaration
Section titled “Type Declaration”ExpiredCredential
Section titled “ExpiredCredential”readonly ExpiredCredential: "expired_credential" = "expired_credential";Well-formed, but outside its validity window.
InsufficientScope
Section titled “InsufficientScope”readonly InsufficientScope: "insufficient_scope" = "insufficient_scope";Identified, but not permitted. Deliberately a 401 rather than a 403: the authenticate callback runs before any method is resolved, so there is no route yet whose permissions could be evaluated. A service wanting a true 403 raises it from the method body.
InvalidCredential
Section titled “InvalidCredential”readonly InvalidCredential: "invalid_credential" = "invalid_credential";A credential was presented and rejected.
MissingCredential
Section titled “MissingCredential”readonly MissingCredential: "missing_credential" = "missing_credential";No credential was presented at all.
ProxyRequired
Section titled “ProxyRequired”readonly ProxyRequired: "proxy_required" = "proxy_required";The request carried no evidence of arriving through the trusted proxy. Derived from server configuration, never from the request.
Unauthorized
Section titled “Unauthorized”readonly Unauthorized: "unauthorized" = "unauthorized";Refused, unclassified. The fallback.
