TypeScript API / laikacms/auth / ResolveBearerDeps
Interface: ResolveBearerDeps
Properties
lookupPatByHash
ts
lookupPatByHash: (hash) => Promise<PatRecord | null | undefined>;Looks up a PAT record by its sha256 hash. Never receives the plaintext token.
Parameters
| Parameter | Type |
|---|---|
hash | string |
Returns
Promise<PatRecord | null | undefined>
now?
ts
optional now?: () => Date;Returns
Date
onPatUsed?
ts
optional onPatUsed?: (record) => void | Promise<void>;Optional side effect (e.g. bump lastUsedAt); failures never fail verification.
Parameters
| Parameter | Type |
|---|---|
record | PatRecord |
Returns
void | Promise<void>
verifySessionToken
ts
verifySessionToken: (bearer) => Promise<
| SessionVerificationResult
| null
| undefined>;Validates a non-PAT bearer against the existing OAuth session-token seam (unchanged). Return null/undefined for an invalid/expired token. Omitting scopes on the result means "full admin", matching today's behaviour where any authenticated session is full-admin.
Parameters
| Parameter | Type |
|---|---|
bearer | string |
Returns
Promise< | SessionVerificationResult | null | undefined>