@asgardeo/react 0.5.22 → 0.5.23
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.
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
import { Context } from 'react';
|
|
19
19
|
import { HttpRequestConfig, HttpResponse, IdToken, Organization, SignInOptions, TokenExchangeRequestConfig, TokenResponse } from '@asgardeo/browser';
|
|
20
20
|
import AsgardeoReactClient from '../../AsgardeoReactClient';
|
|
21
|
+
import { AsgardeoReactConfig } from '../../models/config';
|
|
21
22
|
/**
|
|
22
23
|
* Props interface of {@link AsgardeoContext}
|
|
23
24
|
*/
|
|
@@ -86,7 +87,7 @@ export type AsgardeoContextProps = {
|
|
|
86
87
|
* @example
|
|
87
88
|
* signInOptions: { prompt: "login", fidp: "OrganizationSSO" }
|
|
88
89
|
*/
|
|
89
|
-
signInOptions
|
|
90
|
+
signInOptions: SignInOptions;
|
|
90
91
|
/**
|
|
91
92
|
* Function to retrieve the decoded ID token.
|
|
92
93
|
* This function decodes the ID token and returns its payload.
|
|
@@ -94,21 +95,21 @@ export type AsgardeoContextProps = {
|
|
|
94
95
|
*
|
|
95
96
|
* @returns A promise that resolves to the decoded ID token payload.
|
|
96
97
|
*/
|
|
97
|
-
getDecodedIdToken
|
|
98
|
+
getDecodedIdToken: () => Promise<IdToken>;
|
|
98
99
|
/**
|
|
99
100
|
* Retrieves the access token stored in the storage.
|
|
100
101
|
* This function retrieves the access token and returns it.
|
|
101
102
|
* @remarks This does not work in the `webWorker` or any other worker environment.
|
|
102
103
|
* @returns A promise that resolves to the access token.
|
|
103
104
|
*/
|
|
104
|
-
getAccessToken
|
|
105
|
+
getAccessToken: () => Promise<string>;
|
|
105
106
|
/**
|
|
106
107
|
* Swaps the current access token with a new one based on the provided configuration (with a grant type).
|
|
107
108
|
* @param config - Configuration for the token exchange request.
|
|
108
109
|
* @returns A promise that resolves to the token response or the raw response.
|
|
109
110
|
*/
|
|
110
|
-
exchangeToken
|
|
111
|
-
}
|
|
111
|
+
exchangeToken: (config: TokenExchangeRequestConfig) => Promise<TokenResponse | Response>;
|
|
112
|
+
} & Pick<AsgardeoReactConfig, 'storage'>;
|
|
112
113
|
/**
|
|
113
114
|
* Context object for managing the Authentication flow builder core context.
|
|
114
115
|
*/
|
package/dist/index.js
CHANGED
|
@@ -35,7 +35,8 @@ var AsgardeoContext = createContext({
|
|
|
35
35
|
signInOptions: {},
|
|
36
36
|
getDecodedIdToken: null,
|
|
37
37
|
getAccessToken: null,
|
|
38
|
-
exchangeToken: null
|
|
38
|
+
exchangeToken: null,
|
|
39
|
+
storage: "sessionStorage"
|
|
39
40
|
});
|
|
40
41
|
AsgardeoContext.displayName = "AsgardeoContext";
|
|
41
42
|
var AsgardeoContext_default = AsgardeoContext;
|