doct-ui-auth-kit 1.0.22 → 1.0.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.
- package/dist/index.js +645 -620
- package/dist/pages.js +1 -1
- package/dist/signup-page-26HKuY80.js +1936 -0
- package/dist/types/auth/auth-api-adapter.d.ts +3 -6
- package/dist/types/auth/flow.d.ts +34 -5
- package/dist/types/pages/pages.d.ts +3 -2
- package/package.json +1 -1
- package/dist/signup-page-7_oiaTGe.js +0 -1799
|
@@ -30,15 +30,12 @@ interface LinkOrMergeBaseParams {
|
|
|
30
30
|
}
|
|
31
31
|
export type LinkOrMergeAccountParams = (LinkOrMergeBaseParams & {
|
|
32
32
|
conflictField: 'email';
|
|
33
|
-
oldEmail
|
|
34
|
-
oldCountryCode?: string;
|
|
35
|
-
oldPhone?: string;
|
|
33
|
+
oldEmail: string;
|
|
36
34
|
newEmail: string;
|
|
37
35
|
}) | (LinkOrMergeBaseParams & {
|
|
38
36
|
conflictField: 'phone';
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
oldPhone?: string;
|
|
37
|
+
oldCountryCode: string;
|
|
38
|
+
oldPhone: string;
|
|
42
39
|
newCountryCode: string;
|
|
43
40
|
newPhone: string;
|
|
44
41
|
});
|
|
@@ -5,22 +5,48 @@ import type { AuthStep, SSOSession, UserType } from './auth-types';
|
|
|
5
5
|
/** Identifier type for OTP / profile steps. */
|
|
6
6
|
export type IdentifierType = 'phone' | 'email';
|
|
7
7
|
export type LinkOrMergeConflictField = IdentifierType;
|
|
8
|
+
export type LinkOrMergeStage = 'summary' | 'verification';
|
|
8
9
|
export type LinkOrMergeState = {
|
|
10
|
+
stage: LinkOrMergeStage;
|
|
9
11
|
conflictField: 'email';
|
|
10
12
|
name: string;
|
|
13
|
+
existingEmail?: string;
|
|
14
|
+
existingCountryCode?: string;
|
|
15
|
+
existingPhone?: string;
|
|
11
16
|
oldEmail?: string;
|
|
12
|
-
oldCountryCode?: string;
|
|
13
|
-
oldPhone?: string;
|
|
14
17
|
newEmail: string;
|
|
15
18
|
} | {
|
|
19
|
+
stage: LinkOrMergeStage;
|
|
16
20
|
conflictField: 'phone';
|
|
17
21
|
name: string;
|
|
18
|
-
|
|
22
|
+
existingEmail?: string;
|
|
23
|
+
existingCountryCode?: string;
|
|
24
|
+
existingPhone?: string;
|
|
19
25
|
oldCountryCode?: string;
|
|
20
26
|
oldPhone?: string;
|
|
21
27
|
newCountryCode: string;
|
|
22
28
|
newPhone: string;
|
|
23
29
|
};
|
|
30
|
+
export type LinkOrMergeVerificationInput = {
|
|
31
|
+
conflictField: 'email';
|
|
32
|
+
oldEmail: string;
|
|
33
|
+
newEmail: string;
|
|
34
|
+
} | {
|
|
35
|
+
conflictField: 'phone';
|
|
36
|
+
oldCountryCode: string;
|
|
37
|
+
oldPhone: string;
|
|
38
|
+
newCountryCode: string;
|
|
39
|
+
newPhone: string;
|
|
40
|
+
};
|
|
41
|
+
export type LinkOrMergeSetupPayload = (Omit<Extract<LinkOrMergeState, {
|
|
42
|
+
conflictField: 'email';
|
|
43
|
+
}>, 'stage'> & {
|
|
44
|
+
stage?: LinkOrMergeStage;
|
|
45
|
+
}) | (Omit<Extract<LinkOrMergeState, {
|
|
46
|
+
conflictField: 'phone';
|
|
47
|
+
}>, 'stage'> & {
|
|
48
|
+
stage?: LinkOrMergeStage;
|
|
49
|
+
});
|
|
24
50
|
/** Full state for the auth flow. */
|
|
25
51
|
export interface AuthFlowState {
|
|
26
52
|
step: AuthStep;
|
|
@@ -85,7 +111,9 @@ export type AuthFlowAction = {
|
|
|
85
111
|
maskedRecipient?: string;
|
|
86
112
|
} | ({
|
|
87
113
|
type: 'SET_STEP_LINK_OR_MERGE';
|
|
88
|
-
} &
|
|
114
|
+
} & LinkOrMergeSetupPayload) | {
|
|
115
|
+
type: 'SET_LINK_OR_MERGE_VERIFICATION_STAGE';
|
|
116
|
+
} | {
|
|
89
117
|
type: 'SET_STEP_PROVIDER_PENDING';
|
|
90
118
|
} | {
|
|
91
119
|
type: 'SET_STEP_AUTHENTICATED';
|
|
@@ -147,7 +175,8 @@ export interface AuthFlowActions {
|
|
|
147
175
|
provider: 'google' | 'apple';
|
|
148
176
|
credential: string;
|
|
149
177
|
}) => void;
|
|
150
|
-
|
|
178
|
+
continueLinkOrMerge: () => void;
|
|
179
|
+
verifyLinkOrMerge: (data: LinkOrMergeVerificationInput) => Promise<void>;
|
|
151
180
|
goBack: () => void;
|
|
152
181
|
reset: () => void;
|
|
153
182
|
signOut: () => void;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Props and public types for auth page components.
|
|
3
3
|
*/
|
|
4
4
|
import type { UserType } from '../auth/auth-types';
|
|
5
|
-
import type { IdentifierType, LinkOrMergeState } from '../auth/flow';
|
|
5
|
+
import type { IdentifierType, LinkOrMergeState, LinkOrMergeVerificationInput } from '../auth/flow';
|
|
6
6
|
import type { LoginEntryMode } from './login-form';
|
|
7
7
|
import type { UseMainAuthPageHandlersOptions } from './main-login';
|
|
8
8
|
import type { OtpValidateFn, OtpVerificationMode } from './otp-verification';
|
|
@@ -88,7 +88,8 @@ export interface SignupPageFullProps extends SignupPageProps {
|
|
|
88
88
|
export interface LinkOrMergePageProps {
|
|
89
89
|
details: LinkOrMergeState;
|
|
90
90
|
onBack?: (() => void) | undefined;
|
|
91
|
-
|
|
91
|
+
onContinue: () => void;
|
|
92
|
+
onVerify: (data: LinkOrMergeVerificationInput) => Promise<void>;
|
|
92
93
|
}
|
|
93
94
|
/** Props for OtpVerification (inner form without layout). */
|
|
94
95
|
export interface OtpVerificationProps {
|
package/package.json
CHANGED