@asgardeo/react 0.5.19 → 0.5.21
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.
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import { AsgardeoBrowserClient, UserProfile, SignInOptions, SignOutOptions, User, EmbeddedFlowExecuteResponse, SignUpOptions, EmbeddedFlowExecuteRequestPayload, EmbeddedSignInFlowHandleRequestPayload, Organization, IdToken, EmbeddedFlowExecuteRequestConfig, AllOrganizationsApiResponse, TokenResponse, HttpRequestConfig, HttpResponse, Storage } from '@asgardeo/browser';
|
|
18
|
+
import { AsgardeoBrowserClient, UserProfile, SignInOptions, SignOutOptions, User, EmbeddedFlowExecuteResponse, SignUpOptions, EmbeddedFlowExecuteRequestPayload, EmbeddedSignInFlowHandleRequestPayload, Organization, IdToken, EmbeddedFlowExecuteRequestConfig, AllOrganizationsApiResponse, TokenResponse, HttpRequestConfig, HttpResponse, Storage, TokenExchangeRequestConfig } from '@asgardeo/browser';
|
|
19
19
|
import { AsgardeoReactConfig } from './models/config';
|
|
20
20
|
/**
|
|
21
21
|
* Client for mplementing Asgardeo in React applications.
|
|
@@ -51,6 +51,7 @@ declare class AsgardeoReactClient<T extends AsgardeoReactConfig = AsgardeoReactC
|
|
|
51
51
|
isInitialized(): Promise<boolean>;
|
|
52
52
|
isSignedIn(): Promise<boolean>;
|
|
53
53
|
getConfiguration(): T;
|
|
54
|
+
exchangeToken(config: TokenExchangeRequestConfig, sessionId?: string): Promise<TokenResponse | Response>;
|
|
54
55
|
signIn(options?: SignInOptions, sessionId?: string, onSignInSuccess?: (afterSignInUrl: string) => void): Promise<User>;
|
|
55
56
|
signIn(payload: EmbeddedSignInFlowHandleRequestPayload, request: EmbeddedFlowExecuteRequestConfig, sessionId?: string, onSignInSuccess?: (afterSignInUrl: string) => void): Promise<User>;
|
|
56
57
|
signInSilently(options?: SignInOptions): Promise<User | boolean>;
|
package/dist/cjs/index.js
CHANGED
|
@@ -179,7 +179,9 @@ var AsgardeoContext = (0, import_react.createContext)({
|
|
|
179
179
|
requestAll: () => null
|
|
180
180
|
},
|
|
181
181
|
signInOptions: {},
|
|
182
|
-
getDecodedIdToken: null
|
|
182
|
+
getDecodedIdToken: null,
|
|
183
|
+
getAccessToken: null,
|
|
184
|
+
exchangeToken: null
|
|
183
185
|
});
|
|
184
186
|
AsgardeoContext.displayName = "AsgardeoContext";
|
|
185
187
|
var AsgardeoContext_default = AsgardeoContext;
|
|
@@ -800,6 +802,12 @@ var AsgardeoReactClient = class extends import_browser6.AsgardeoBrowserClient {
|
|
|
800
802
|
getConfiguration() {
|
|
801
803
|
return this.asgardeo.getConfigData();
|
|
802
804
|
}
|
|
805
|
+
async exchangeToken(config, sessionId) {
|
|
806
|
+
return this.withLoading(async () => {
|
|
807
|
+
return this.asgardeo.exchangeToken(config, (user) => {
|
|
808
|
+
});
|
|
809
|
+
});
|
|
810
|
+
}
|
|
803
811
|
async signIn(...args) {
|
|
804
812
|
return this.withLoading(async () => {
|
|
805
813
|
const arg1 = args[0];
|
|
@@ -1785,6 +1793,7 @@ var AsgardeoProvider = ({
|
|
|
1785
1793
|
},
|
|
1786
1794
|
signInOptions,
|
|
1787
1795
|
getDecodedIdToken: asgardeo.getDecodedIdToken.bind(asgardeo),
|
|
1796
|
+
exchangeToken: asgardeo.exchangeToken.bind(asgardeo),
|
|
1788
1797
|
syncSession
|
|
1789
1798
|
}),
|
|
1790
1799
|
[
|
|
@@ -2674,8 +2683,6 @@ var BaseSignOutButton = (0, import_react29.forwardRef)(
|
|
|
2674
2683
|
disabled: isLoading,
|
|
2675
2684
|
loading: isLoading,
|
|
2676
2685
|
type: "button",
|
|
2677
|
-
color: "primary",
|
|
2678
|
-
variant: "outline",
|
|
2679
2686
|
...rest,
|
|
2680
2687
|
children
|
|
2681
2688
|
}
|
|
@@ -2746,8 +2753,6 @@ var BaseSignUpButton = (0, import_react31.forwardRef)(
|
|
|
2746
2753
|
disabled: isLoading,
|
|
2747
2754
|
loading: isLoading,
|
|
2748
2755
|
type: "button",
|
|
2749
|
-
color: "primary",
|
|
2750
|
-
variant: "outline",
|
|
2751
2756
|
...rest,
|
|
2752
2757
|
children
|
|
2753
2758
|
}
|