Class: AuthManager
Manages authentication operations.
Constructors
new AuthManager()
Internal
Parameters
| Parameter | Type |
|---|---|
ctx | ClientContext |
Returns
Defined in
4Players/cortex-typescript-sdk/src/resources/auth.ts:18
Methods
getProfile()
Get the current user's profile
Returns
Promise<object>
User profile
| Name | Type | Description | Defined in |
|---|---|---|---|
tenantId | string | Description Tenant ID Example tenant_456 | 4Players/cortex-typescript-sdk/src/types.ts:1961 |
userId | string | Description User ID Example user_123 | 4Players/cortex-typescript-sdk/src/types.ts:1956 |
username | string | Description User name Example John Doe | 4Players/cortex-typescript-sdk/src/types.ts:1966 |
Defined in
4Players/cortex-typescript-sdk/src/resources/auth.ts:50
login()
Login with a Fusion Session ID
Parameters
| Parameter | Type | Description |
|---|---|---|
body | object | Fusion session credentials |
body.fusionSessionId | string | Description Fusion Session ID for authentication Example fsid_1234567890 |
Returns
Promise<object>
JWT access token
| Name | Type | Description | Defined in |
|---|---|---|---|
accessToken | string | Description JWT access token Example eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... | 4Players/cortex-typescript-sdk/src/types.ts:1932 |
sessionId? | string | Description Fusion Session ID for Fleet and Payment SDK authentication. Only returned from the credentials login flow. Example abc123def456 | 4Players/cortex-typescript-sdk/src/types.ts:1937 |
Defined in
4Players/cortex-typescript-sdk/src/resources/auth.ts:25
loginWithCredentials()
Login with email and password
Parameters
| Parameter | Type | Description |
|---|---|---|
body | object | Email and password credentials |
body.email | string | Description User email address Example user@example.com |
body.password | string | Description User password Example password123 |
Returns
Promise<object>
JWT access token
| Name | Type | Description | Defined in |
|---|---|---|---|
accessToken | string | Description JWT access token Example eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... | 4Players/cortex-typescript-sdk/src/types.ts:1932 |
sessionId? | string | Description Fusion Session ID for Fleet and Payment SDK authentication. Only returned from the credentials login flow. Example abc123def456 | 4Players/cortex-typescript-sdk/src/types.ts:1937 |
Defined in
4Players/cortex-typescript-sdk/src/resources/auth.ts:38