Skip to main content

Class: AuthManager

Manages authentication operations.

Constructors

new AuthManager()

new AuthManager(ctx): AuthManager

Internal

Parameters

ParameterType
ctxClientContext

Returns

AuthManager

Defined in

4Players/cortex-typescript-sdk/src/resources/auth.ts:18

Methods

getProfile()

getProfile(): Promise<object>

Get the current user's profile

Returns

Promise<object>

User profile

NameTypeDescriptionDefined in
tenantIdstringDescription Tenant ID Example tenant_4564Players/cortex-typescript-sdk/src/types.ts:1961
userIdstringDescription User ID Example user_1234Players/cortex-typescript-sdk/src/types.ts:1956
usernamestringDescription User name Example John Doe4Players/cortex-typescript-sdk/src/types.ts:1966

Defined in

4Players/cortex-typescript-sdk/src/resources/auth.ts:50


login()

login(body): Promise<object>

Login with a Fusion Session ID

Parameters

ParameterTypeDescription
bodyobjectFusion session credentials
body.fusionSessionIdstringDescription Fusion Session ID for authentication Example fsid_1234567890

Returns

Promise<object>

JWT access token

NameTypeDescriptionDefined in
accessTokenstringDescription JWT access token Example eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...4Players/cortex-typescript-sdk/src/types.ts:1932
sessionId?stringDescription Fusion Session ID for Fleet and Payment SDK authentication. Only returned from the credentials login flow. Example abc123def4564Players/cortex-typescript-sdk/src/types.ts:1937

Defined in

4Players/cortex-typescript-sdk/src/resources/auth.ts:25


loginWithCredentials()

loginWithCredentials(body): Promise<object>

Login with email and password

Parameters

ParameterTypeDescription
bodyobjectEmail and password credentials
body.emailstringDescription User email address Example user@example.com
body.passwordstringDescription User password Example password123

Returns

Promise<object>

JWT access token

NameTypeDescriptionDefined in
accessTokenstringDescription JWT access token Example eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...4Players/cortex-typescript-sdk/src/types.ts:1932
sessionId?stringDescription Fusion Session ID for Fleet and Payment SDK authentication. Only returned from the credentials login flow. Example abc123def4564Players/cortex-typescript-sdk/src/types.ts:1937

Defined in

4Players/cortex-typescript-sdk/src/resources/auth.ts:38