@asgardeo/browser 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__legacy__/client.d.ts +23 -0
- package/dist/__legacy__/models/client.d.ts +2 -0
- package/dist/cjs/index.js +36 -4
- package/dist/cjs/index.js.map +2 -2
- package/dist/index.js +36 -4
- package/dist/index.js.map +2 -2
- package/package.json +2 -2
|
@@ -380,6 +380,29 @@ export declare class AsgardeoSPAClient {
|
|
|
380
380
|
* @preserve
|
|
381
381
|
*/
|
|
382
382
|
getHttpClient(): HttpClientInstance;
|
|
383
|
+
/**
|
|
384
|
+
* This method decodes a JWT token payload and returns it.
|
|
385
|
+
*
|
|
386
|
+
* @param {string} token - The token to decode (optional).
|
|
387
|
+
*
|
|
388
|
+
* @return {Promise<Record<string, unknown>>} - A Promise that resolves with
|
|
389
|
+
* the decoded payload of the token.
|
|
390
|
+
*
|
|
391
|
+
* @example
|
|
392
|
+
* ```
|
|
393
|
+
* auth.decodeJwtToken<T>(token).then((response)=>{
|
|
394
|
+
* // console.log(response);
|
|
395
|
+
* }).catch((error)=>{
|
|
396
|
+
* // console.error(error);
|
|
397
|
+
* });
|
|
398
|
+
* ```
|
|
399
|
+
* @link https://github.com/asgardeo/asgardeo-auth-spa-sdk/tree/master#decodetoken
|
|
400
|
+
*
|
|
401
|
+
* @memberof AsgardeoSPAClient
|
|
402
|
+
*
|
|
403
|
+
* @preserve
|
|
404
|
+
*/
|
|
405
|
+
decodeJwtToken<T = Record<string, unknown>>(token?: string): Promise<T | undefined>;
|
|
383
406
|
/**
|
|
384
407
|
* This method decodes the payload of the id token and returns it.
|
|
385
408
|
*
|
|
@@ -49,6 +49,7 @@ export interface MainThreadClientInterface {
|
|
|
49
49
|
params: Record<string, unknown>;
|
|
50
50
|
}): Promise<User | boolean>;
|
|
51
51
|
isSessionActive(): Promise<boolean>;
|
|
52
|
+
decodeJwtToken: <T = Record<string, unknown>>(token: string) => Promise<T>;
|
|
52
53
|
}
|
|
53
54
|
export interface WebWorkerClientInterface {
|
|
54
55
|
exchangeToken(requestParams: TokenExchangeRequestConfig): Promise<Response | User>;
|
|
@@ -79,4 +80,5 @@ export interface WebWorkerClientInterface {
|
|
|
79
80
|
signInSilently(additionalParams?: Record<string, string | boolean>, tokenRequestConfig?: {
|
|
80
81
|
params: Record<string, unknown>;
|
|
81
82
|
}): Promise<User | boolean>;
|
|
83
|
+
decodeJwtToken: <T = Record<string, unknown>>(token: string) => Promise<T>;
|
|
82
84
|
}
|