Skip to main content

AdminUserAuthorizationResult

AdminUserAuthorizationResult = { adminUser: AdminUser; status: "ok"; } | { status: "noToken"; } | { status: "invalidToken"; } | { error: any; status: "verifyFailed"; } | { error?: string; status: "notAllowed"; }

Result of IAdminForthAuth.authorizeByCookies. Statuses are separated because caller decides how to answer: authenticated endpoints answer 401 on any non-ok status except verifyFailed (which is a server side problem and must not logout user), while noAuth endpoints just treat caller as anonymous.

Union Members

Type Literal

{ adminUser: AdminUser; status: "ok"; }


Type Literal

{ status: "noToken"; }

no auth cookie in request at all


Type Literal

{ status: "invalidToken"; }

jwt is expired, malformed or its user does not exist anymore


Type Literal

{ error: any; status: "verifyFailed"; }

verification itself failed, e.g. database is not ready yet


Type Literal

{ error?: string; status: "notAllowed"; }

one of adminUserAuthorize hooks denied the user