ScopedAuth
Defined in: src/server/http.ts:156
How a product verifies its scoped (portal / viewer) tokens.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
Grant |
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
prefix |
string |
The token prefix ("whpt_"…). A Bearer <prefix>… header takes the scoped lane. |
src/server/http.ts:158 |
Methods
Section titled “Methods”principal()
Section titled “principal()”principal(grant): Principal;Defined in: src/server/http.ts:162
The principal a verified grant acts as (e.g. { id: "portal:acme" }).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
grant |
Grant |
Returns
Section titled “Returns”verify()
Section titled “verify()”verify(token, request): Promise<Grant>;Defined in: src/server/http.ts:160
Verify the token; throw (e.g. a TokenError) when it is invalid or expired.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
token |
string |
request |
Request |
Returns
Section titled “Returns”Promise<Grant>