Skip to main content

ClaimsHelper

@appfire/fuse-auth-coreDocs


@appfire/fuse-auth-core / ClaimsHelper

Class: ClaimsHelper

Helper class for working with claims in a token.

Constructors

new ClaimsHelper()

new ClaimsHelper(): ClaimsHelper

Returns

ClaimsHelper

Properties

getUserIdFromToken()

static getUserIdFromToken: (token, productType) => string

Retrieves the user ID from the given token based on the product type.

Parameters

token: string

The token from which to extract the user ID.

productType: "monday" | "confluence" | "jira" | "bitbucket"

The type of product (e.g., 'Atlassian', 'Monday').

Returns

string

The user ID extracted from the token.

Throws

Error if the product type is invalid.

Defined in

helpers/claims.helper.ts:36


tokenClaims()

static tokenClaims: (token) => Claims

Retrieves the claims from the given token.

Parameters

token: string

The token from which to extract the claims.

Returns

Claims

The claims extracted from the token.

Defined in

helpers/claims.helper.ts:21