jwt

Types from the Go package jwt (a library PocketBase builds on), as JavaScript sees them: they turn up as values of PocketBase's types and of hook events.

jwt.MapClaims

MapClaims is a claims type that uses the map[string]any for JSON decoding. This is the default claims type if you don't supply one

Has everything { [key: string]: any } has.

Member Type
getExpirationTime() (): (NumericDate) GetExpirationTime implements the Claims interface.
getNotBefore() (): (NumericDate) GetNotBefore implements the Claims interface.
getIssuedAt() (): (NumericDate) GetIssuedAt implements the Claims interface.
getAudience() (): ClaimStrings GetAudience implements the Claims interface.
getIssuer() (): string GetIssuer implements the Claims interface.
getSubject() (): string GetSubject implements the Claims interface.

jwt.NumericDate

Has everything time.Time has.

Member Type
marshalJSON() (): string|Array<number> MarshalJSON is an implementation of the json.RawMessage interface and serializes the UNIX epoch represented in NumericDate to a byte array, using the precision specified in TimePrecision.
unmarshalJSON() (b: string|Array<number>): void UnmarshalJSON is an implementation of the json.RawMessage interface and deserializes a NumericDate from a JSON representation, i.e. a json.number. This number represents an UNIX epoch with either integer or non-integer seconds.

jwt.ClaimStrings

ClaimStrings is basically just a slice of strings, but it can be either serialized from a string array or just a string. This type is necessary, since the "aud" claim can either be a single string or an array.

Has everything Array<string> has.

Member Type
unmarshalJSON() (data: string|Array<number>): void
marshalJSON() (): string|Array<number>