@asgardeo/react 0.21.3 → 0.22.0
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/cjs/index.js +121 -89
- package/dist/cjs/index.js.map +2 -2
- package/dist/components/presentation/auth/AcceptInvite/v2/AcceptInvite.d.ts +3 -3
- package/dist/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.d.ts +6 -6
- package/dist/components/presentation/auth/InviteUser/v2/BaseInviteUser.d.ts +7 -3
- package/dist/components/presentation/auth/InviteUser/v2/InviteUser.d.ts +1 -1
- package/dist/hooks/v2/useOAuthCallback.d.ts +9 -9
- package/dist/index.js +121 -89
- package/dist/index.js.map +2 -2
- package/dist/utils/v2/flowTransformer.d.ts +4 -4
- package/package.json +2 -2
|
@@ -43,7 +43,7 @@ export interface AcceptInviteProps {
|
|
|
43
43
|
* Flow ID from the invite link.
|
|
44
44
|
* If not provided, will be extracted from URL query parameters.
|
|
45
45
|
*/
|
|
46
|
-
|
|
46
|
+
executionId?: string;
|
|
47
47
|
/**
|
|
48
48
|
* Invite token from the invite link.
|
|
49
49
|
* If not provided, will be extracted from URL query parameters.
|
|
@@ -87,7 +87,7 @@ export interface AcceptInviteProps {
|
|
|
87
87
|
*
|
|
88
88
|
* This component is designed for end users accessing the thunder-gate app via an invite link.
|
|
89
89
|
* It automatically:
|
|
90
|
-
* 1. Extracts
|
|
90
|
+
* 1. Extracts executionId and inviteToken from URL query parameters
|
|
91
91
|
* 2. Validates the invite token with the backend
|
|
92
92
|
* 3. Displays the password form if token is valid
|
|
93
93
|
* 4. Completes the accept invite when password is set
|
|
@@ -96,7 +96,7 @@ export interface AcceptInviteProps {
|
|
|
96
96
|
* ```tsx
|
|
97
97
|
* import { AcceptInvite } from '@asgardeo/react';
|
|
98
98
|
*
|
|
99
|
-
* // URL: /invite?
|
|
99
|
+
* // URL: /invite?executionId=xxx&inviteToken=yyy
|
|
100
100
|
*
|
|
101
101
|
* const AcceptInvitePage = () => {
|
|
102
102
|
* return (
|
|
@@ -30,8 +30,8 @@ export interface AcceptInviteFlowResponse {
|
|
|
30
30
|
};
|
|
31
31
|
redirectURL?: string;
|
|
32
32
|
};
|
|
33
|
+
executionId: string;
|
|
33
34
|
failureReason?: string;
|
|
34
|
-
flowId: string;
|
|
35
35
|
flowStatus: 'INCOMPLETE' | 'COMPLETE' | 'ERROR';
|
|
36
36
|
type?: 'VIEW' | 'REDIRECTION';
|
|
37
37
|
}
|
|
@@ -48,13 +48,13 @@ export interface BaseAcceptInviteRenderProps {
|
|
|
48
48
|
*/
|
|
49
49
|
error?: Error | null;
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
51
|
+
* Current flow ID from URL.
|
|
52
52
|
*/
|
|
53
|
-
|
|
53
|
+
executionId?: string;
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
55
|
+
* Field validation errors.
|
|
56
56
|
*/
|
|
57
|
-
|
|
57
|
+
fieldErrors: Record<string, string>;
|
|
58
58
|
/**
|
|
59
59
|
* Navigate to sign in page.
|
|
60
60
|
*/
|
|
@@ -132,7 +132,7 @@ export interface BaseAcceptInviteProps {
|
|
|
132
132
|
/**
|
|
133
133
|
* Flow ID from the invite link URL.
|
|
134
134
|
*/
|
|
135
|
-
|
|
135
|
+
executionId?: string;
|
|
136
136
|
/**
|
|
137
137
|
* Invite token from the invite link URL.
|
|
138
138
|
*/
|
|
@@ -29,8 +29,8 @@ export interface InviteUserFlowResponse {
|
|
|
29
29
|
components?: any[];
|
|
30
30
|
};
|
|
31
31
|
};
|
|
32
|
+
executionId: string;
|
|
32
33
|
failureReason?: string;
|
|
33
|
-
flowId: string;
|
|
34
34
|
flowStatus: 'INCOMPLETE' | 'COMPLETE' | 'ERROR';
|
|
35
35
|
type?: 'VIEW' | 'REDIRECTION';
|
|
36
36
|
}
|
|
@@ -50,14 +50,18 @@ export interface BaseInviteUserRenderProps {
|
|
|
50
50
|
* API error (if any).
|
|
51
51
|
*/
|
|
52
52
|
error?: Error | null;
|
|
53
|
+
/**
|
|
54
|
+
* Current flow execution ID.
|
|
55
|
+
*/
|
|
56
|
+
executionId?: string;
|
|
53
57
|
/**
|
|
54
58
|
* Field validation errors.
|
|
55
59
|
*/
|
|
56
60
|
fieldErrors: Record<string, string>;
|
|
57
61
|
/**
|
|
58
|
-
* Current flow ID.
|
|
62
|
+
* Current flow execution ID.
|
|
59
63
|
*/
|
|
60
|
-
|
|
64
|
+
flowExecId?: string;
|
|
61
65
|
/**
|
|
62
66
|
* Function to handle input blur.
|
|
63
67
|
*/
|
|
@@ -79,7 +79,7 @@ export interface InviteUserProps {
|
|
|
79
79
|
*
|
|
80
80
|
* return (
|
|
81
81
|
* <InviteUser
|
|
82
|
-
* onInviteLinkGenerated={(link,
|
|
82
|
+
* onInviteLinkGenerated={(link, executionId) => setInviteLink(link)}
|
|
83
83
|
* onError={(error) => console.error(error)}
|
|
84
84
|
* >
|
|
85
85
|
* {({ values, components, isLoading, handleInputChange, handleSubmit, inviteLink, isInviteGenerated }) => (
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
import { type RefObject } from 'react';
|
|
19
19
|
export interface UseOAuthCallbackOptions {
|
|
20
20
|
/**
|
|
21
|
-
* Current
|
|
21
|
+
* Current executionId from component state
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
currentExecutionId: string | null;
|
|
24
24
|
/**
|
|
25
|
-
* SessionStorage key for
|
|
25
|
+
* SessionStorage key for executionId (defaults to 'asgardeo_execution_id')
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
executionIdStorageKey?: string;
|
|
28
28
|
/**
|
|
29
29
|
* Whether the component is initialized and ready to process OAuth callback
|
|
30
30
|
*/
|
|
@@ -59,9 +59,9 @@ export interface UseOAuthCallbackOptions {
|
|
|
59
59
|
*/
|
|
60
60
|
processedRef?: RefObject<boolean>;
|
|
61
61
|
/**
|
|
62
|
-
* Additional handler for setting state (e.g.,
|
|
62
|
+
* Additional handler for setting state (e.g., setExecutionId)
|
|
63
63
|
*/
|
|
64
|
-
|
|
64
|
+
setExecutionId?: (executionId: string) => void;
|
|
65
65
|
/**
|
|
66
66
|
* Ref to mark that token validation was attempted (prevents duplicate validation)
|
|
67
67
|
* Used in AcceptInvite to coordinate between OAuth callback and token validation
|
|
@@ -69,14 +69,14 @@ export interface UseOAuthCallbackOptions {
|
|
|
69
69
|
tokenValidationAttemptedRef?: RefObject<boolean>;
|
|
70
70
|
}
|
|
71
71
|
export interface OAuthCallbackPayload {
|
|
72
|
-
|
|
72
|
+
executionId: string;
|
|
73
73
|
inputs: {
|
|
74
74
|
code: string;
|
|
75
75
|
nonce?: string;
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
79
|
-
* Processes OAuth callbacks by detecting auth code in URL, resolving
|
|
79
|
+
* Processes OAuth callbacks by detecting auth code in URL, resolving executionId, and submitting to server.
|
|
80
80
|
* Used by SignIn, SignUp, and AcceptInvite components.
|
|
81
81
|
*/
|
|
82
|
-
export declare function useOAuthCallback({
|
|
82
|
+
export declare function useOAuthCallback({ currentExecutionId, executionIdStorageKey, isInitialized, isSubmitting, onComplete, onError, onFlowChange, onProcessingStart, onSubmit, processedRef, setExecutionId: setExecExecutionId, tokenValidationAttemptedRef, }: UseOAuthCallbackOptions): void;
|