@ollaid/native-sso 1.0.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/README.md +1682 -0
- package/dist/components/AppsLogoSlider.d.ts +9 -0
- package/dist/components/DebugPanel.d.ts +12 -0
- package/dist/components/LoginModal.d.ts +20 -0
- package/dist/components/NativeSSOPage.d.ts +35 -0
- package/dist/components/OTPInput.d.ts +13 -0
- package/dist/components/OnboardingModal.d.ts +23 -0
- package/dist/components/PasswordRecoveryModal.d.ts +17 -0
- package/dist/components/PhoneInput.d.ts +15 -0
- package/dist/components/SignupModal.d.ts +18 -0
- package/dist/components/ui.d.ts +70 -0
- package/dist/hooks/useMobilePassword.d.ts +94 -0
- package/dist/hooks/useMobileRegistration.d.ts +148 -0
- package/dist/hooks/useNativeAuth.d.ts +262 -0
- package/dist/hooks/useTokenHealthCheck.d.ts +25 -0
- package/dist/index.cjs +4493 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +4493 -0
- package/dist/index.js.map +1 -0
- package/dist/provider.d.ts +38 -0
- package/dist/services/api.d.ts +49 -0
- package/dist/services/debugLogger.d.ts +23 -0
- package/dist/services/iamAccount.d.ts +45 -0
- package/dist/services/mobilePassword.d.ts +19 -0
- package/dist/services/mobileRegistration.d.ts +31 -0
- package/dist/services/nativeAuth.d.ts +55 -0
- package/dist/types/mobile.d.ts +128 -0
- package/dist/types/native.d.ts +289 -0
- package/package.json +50 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apps Logo Slider for @ollaid/native-sso
|
|
3
|
+
*/
|
|
4
|
+
interface AppsLogoSliderProps {
|
|
5
|
+
speed?: 'slow' | 'normal' | 'fast';
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function AppsLogoSlider({ speed, className }: AppsLogoSliderProps): import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
export default AppsLogoSlider;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DebugPanel — Panneau de debug flottant pour @ollaid/native-sso
|
|
3
|
+
* Affiche l'historique des appels API en temps réel (style terminal)
|
|
4
|
+
* N'apparaît que quand debug=true
|
|
5
|
+
* @version 1.0.0
|
|
6
|
+
*/
|
|
7
|
+
interface DebugPanelProps {
|
|
8
|
+
saasApiUrl: string;
|
|
9
|
+
iamApiUrl: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function DebugPanel({ saasApiUrl, iamApiUrl }: DebugPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default DebugPanel;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Login Modal for @ollaid/native-sso
|
|
3
|
+
* Complete login flow aligned with web SSO /sso/auth design
|
|
4
|
+
*
|
|
5
|
+
* @version 1.0.0
|
|
6
|
+
*/
|
|
7
|
+
import type { UserInfos } from '../types/native';
|
|
8
|
+
export interface LoginModalProps {
|
|
9
|
+
open: boolean;
|
|
10
|
+
onOpenChange: (open: boolean) => void;
|
|
11
|
+
onSwitchToSignup: () => void;
|
|
12
|
+
onLoginSuccess?: (token: string, user: UserInfos) => void;
|
|
13
|
+
saasApiUrl: string;
|
|
14
|
+
iamApiUrl: string;
|
|
15
|
+
loading?: boolean;
|
|
16
|
+
showSwitchToSignup?: boolean;
|
|
17
|
+
debug?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function LoginModal({ open, onOpenChange, onSwitchToSignup, onLoginSuccess, saasApiUrl, iamApiUrl, loading, showSwitchToSignup, debug, }: LoginModalProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export default LoginModal;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NativeSSOPage — Page autonome complète pour @ollaid/native-sso
|
|
3
|
+
* Design aligné sur /sso/auth (fond primary, card blanche, ShieldCheck branding)
|
|
4
|
+
*
|
|
5
|
+
* @version 1.0.0
|
|
6
|
+
*/
|
|
7
|
+
import type { UserInfos } from '../types/native';
|
|
8
|
+
export interface NativeSSOPageProps {
|
|
9
|
+
/** URL du Backend SaaS */
|
|
10
|
+
saasApiUrl: string;
|
|
11
|
+
/** URL du Backend IAM */
|
|
12
|
+
iamApiUrl: string;
|
|
13
|
+
/** Callback après login/signup réussi — reçoit le token et l'utilisateur */
|
|
14
|
+
onLoginSuccess?: (token: string, user: UserInfos) => void;
|
|
15
|
+
/** Callback après logout */
|
|
16
|
+
onLogout?: () => void;
|
|
17
|
+
/** Callback quand l'utilisateur complète l'onboarding (photo/phone) */
|
|
18
|
+
onOnboardingComplete?: (data: {
|
|
19
|
+
image_url?: string;
|
|
20
|
+
ccphone?: string;
|
|
21
|
+
phone?: string;
|
|
22
|
+
}) => void;
|
|
23
|
+
/** Mode debug */
|
|
24
|
+
debug?: boolean;
|
|
25
|
+
/** Titre personnalisé */
|
|
26
|
+
title?: string;
|
|
27
|
+
/** Description personnalisée */
|
|
28
|
+
description?: string;
|
|
29
|
+
/** Logo URL personnalisé */
|
|
30
|
+
logoUrl?: string;
|
|
31
|
+
/** Masquer le footer "Propulsé par" */
|
|
32
|
+
hideFooter?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare function NativeSSOPage({ saasApiUrl, iamApiUrl, onLoginSuccess, onLogout, onOnboardingComplete, debug, title, description, logoUrl, hideFooter, }: NativeSSOPageProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export default NativeSSOPage;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OTP Input component for @ollaid/native-sso
|
|
3
|
+
*/
|
|
4
|
+
interface OTPInputProps {
|
|
5
|
+
length?: 6 | 8;
|
|
6
|
+
value: string;
|
|
7
|
+
onChange: (value: string) => void;
|
|
8
|
+
onComplete?: (value: string) => void;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
autoFocus?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function OTPInput({ length, value, onChange, onComplete, disabled, autoFocus, }: OTPInputProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default OTPInput;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OnboardingModal — Post-login modal for missing profile info
|
|
3
|
+
* Asks for photo + phone if not present in user_infos
|
|
4
|
+
*
|
|
5
|
+
* @version 1.0.0
|
|
6
|
+
*/
|
|
7
|
+
import type { NativeUser } from '../types/native';
|
|
8
|
+
export interface OnboardingModalProps {
|
|
9
|
+
open: boolean;
|
|
10
|
+
onOpenChange: (open: boolean) => void;
|
|
11
|
+
user: NativeUser;
|
|
12
|
+
/** Called with updated data when user submits */
|
|
13
|
+
onComplete: (data: {
|
|
14
|
+
image_url?: string;
|
|
15
|
+
ccphone?: string;
|
|
16
|
+
phone?: string;
|
|
17
|
+
email?: string;
|
|
18
|
+
}) => void;
|
|
19
|
+
/** Called when user skips onboarding */
|
|
20
|
+
onSkip: () => void;
|
|
21
|
+
}
|
|
22
|
+
export declare function OnboardingModal({ open, onOpenChange, user, onComplete, onSkip }: OnboardingModalProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export default OnboardingModal;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Password Recovery Modal for @ollaid/native-sso
|
|
3
|
+
* Flow: email → method-choice → OTP → new password → success
|
|
4
|
+
* Design aligned with web SSO
|
|
5
|
+
*
|
|
6
|
+
* @version 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
export interface PasswordRecoveryModalProps {
|
|
9
|
+
open: boolean;
|
|
10
|
+
onOpenChange: (open: boolean) => void;
|
|
11
|
+
onSuccess: () => void;
|
|
12
|
+
saasApiUrl: string;
|
|
13
|
+
iamApiUrl: string;
|
|
14
|
+
debug?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function PasswordRecoveryModal({ open, onOpenChange, onSuccess, saasApiUrl, iamApiUrl, debug }: PasswordRecoveryModalProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export default PasswordRecoveryModal;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phone Input component for @ollaid/native-sso
|
|
3
|
+
*/
|
|
4
|
+
interface PhoneInputProps {
|
|
5
|
+
value: string;
|
|
6
|
+
onChange: (value: string) => void;
|
|
7
|
+
ccphone?: string;
|
|
8
|
+
onCcphoneChange?: (value: string) => void;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
error?: string;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
lockCcphone?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function PhoneInput({ value, onChange, ccphone, onCcphoneChange, disabled, error, placeholder, lockCcphone, }: PhoneInputProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export default PhoneInput;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Signup Modal for @ollaid/native-sso — Design aligned with web SSO
|
|
3
|
+
* Full signup flow: intro → account-type → info → OTP → password → confirm → success
|
|
4
|
+
*
|
|
5
|
+
* @version 1.0.0
|
|
6
|
+
*/
|
|
7
|
+
import type { UserInfos } from '../types/native';
|
|
8
|
+
export interface SignupModalProps {
|
|
9
|
+
open: boolean;
|
|
10
|
+
onOpenChange: (open: boolean) => void;
|
|
11
|
+
onSwitchToLogin: () => void;
|
|
12
|
+
onSignupSuccess: (token: string, user: UserInfos) => void;
|
|
13
|
+
saasApiUrl: string;
|
|
14
|
+
iamApiUrl: string;
|
|
15
|
+
debug?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function SignupModal({ open, onOpenChange, onSwitchToLogin, onSignupSuccess, saasApiUrl, iamApiUrl, debug }: SignupModalProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export default SignupModal;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Embedded UI primitives for @ollaid/native-sso
|
|
3
|
+
* Lightweight replacements for shadcn/ui components + inline SVG icons
|
|
4
|
+
* No external dependencies required
|
|
5
|
+
*
|
|
6
|
+
* @version 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
import React from 'react';
|
|
9
|
+
export declare function IconShieldCheck(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function IconMail(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function IconPhone(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function IconLock(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function IconKeyRound(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function IconArrowLeft(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function IconEye(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function IconEyeOff(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function IconCheckCircle2(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function IconLoader2(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function IconAlertTriangle(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare function IconSmartphone(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function IconHome(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare function IconCalendar(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare function IconBell(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare function IconMessageCircle(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare function IconUsers(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare function IconSettings(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare function IconGlobe(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare function Dialog({ open, onOpenChange, children }: {
|
|
29
|
+
open: boolean;
|
|
30
|
+
onOpenChange: (open: boolean) => void;
|
|
31
|
+
children: React.ReactNode;
|
|
32
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
33
|
+
export declare function DialogContent({ children, className }: {
|
|
34
|
+
children: React.ReactNode;
|
|
35
|
+
className?: string;
|
|
36
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare function DialogHeader({ children, className, style }: {
|
|
38
|
+
children: React.ReactNode;
|
|
39
|
+
className?: string;
|
|
40
|
+
style?: React.CSSProperties;
|
|
41
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export declare function DialogTitle({ children, className }: {
|
|
43
|
+
children: React.ReactNode;
|
|
44
|
+
className?: string;
|
|
45
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
export declare function DialogDescription({ children, className }: {
|
|
47
|
+
children: React.ReactNode;
|
|
48
|
+
className?: string;
|
|
49
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
51
|
+
variant?: 'default' | 'outline' | 'ghost';
|
|
52
|
+
size?: 'default' | 'sm' | 'lg';
|
|
53
|
+
}
|
|
54
|
+
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
55
|
+
export declare const Input: React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
56
|
+
className?: string;
|
|
57
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
58
|
+
export declare const Label: React.ForwardRefExoticComponent<React.LabelHTMLAttributes<HTMLLabelElement> & React.RefAttributes<HTMLLabelElement>>;
|
|
59
|
+
interface RadioGroupProps {
|
|
60
|
+
value: string;
|
|
61
|
+
onValueChange: (value: string) => void;
|
|
62
|
+
children: React.ReactNode;
|
|
63
|
+
className?: string;
|
|
64
|
+
}
|
|
65
|
+
export declare function RadioGroup({ value, onValueChange, children, className }: RadioGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
66
|
+
export declare function RadioGroupItem({ value, id }: {
|
|
67
|
+
value: string;
|
|
68
|
+
id: string;
|
|
69
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
70
|
+
export {};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook de récupération de mot de passe v1.0
|
|
3
|
+
* Architecture Frontend-First avec appels directs à l'IAM
|
|
4
|
+
*
|
|
5
|
+
* @version 1.0.0
|
|
6
|
+
*/
|
|
7
|
+
export interface UseMobilePasswordOptions {
|
|
8
|
+
saasApiUrl: string;
|
|
9
|
+
iamApiUrl: string;
|
|
10
|
+
autoLoadCredentials?: boolean;
|
|
11
|
+
debug?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function useMobilePassword(options: UseMobilePasswordOptions): {
|
|
14
|
+
credentialsLoaded: boolean;
|
|
15
|
+
processToken: string | null;
|
|
16
|
+
status: import("..").MobilePasswordStatus;
|
|
17
|
+
storedOtp: string | null;
|
|
18
|
+
receiveMode: "email" | "phone" | null;
|
|
19
|
+
maskedEmail: string | null;
|
|
20
|
+
maskedPhone: string | null;
|
|
21
|
+
loading: boolean;
|
|
22
|
+
error: string | null;
|
|
23
|
+
errorType: string | null;
|
|
24
|
+
isCompleted: boolean;
|
|
25
|
+
isChoiceRequired: boolean;
|
|
26
|
+
isPendingOtp: boolean;
|
|
27
|
+
isPendingPassword: boolean;
|
|
28
|
+
loadCredentials: () => Promise<{
|
|
29
|
+
success: boolean;
|
|
30
|
+
error_type?: undefined;
|
|
31
|
+
} | {
|
|
32
|
+
success: boolean;
|
|
33
|
+
error_type: string;
|
|
34
|
+
}>;
|
|
35
|
+
initRecovery: (email: string) => Promise<{
|
|
36
|
+
success: boolean;
|
|
37
|
+
status: "choice_required";
|
|
38
|
+
error_type?: undefined;
|
|
39
|
+
} | {
|
|
40
|
+
success: boolean;
|
|
41
|
+
status: "pending_otp";
|
|
42
|
+
error_type?: undefined;
|
|
43
|
+
} | {
|
|
44
|
+
success: boolean;
|
|
45
|
+
error_type: string | undefined;
|
|
46
|
+
status?: undefined;
|
|
47
|
+
}>;
|
|
48
|
+
selectMethod: (choice: "email" | "phone") => Promise<{
|
|
49
|
+
success: boolean;
|
|
50
|
+
error: string;
|
|
51
|
+
error_type?: undefined;
|
|
52
|
+
} | {
|
|
53
|
+
success: boolean;
|
|
54
|
+
error?: undefined;
|
|
55
|
+
error_type?: undefined;
|
|
56
|
+
} | {
|
|
57
|
+
success: boolean;
|
|
58
|
+
error_type: string | undefined;
|
|
59
|
+
error?: undefined;
|
|
60
|
+
}>;
|
|
61
|
+
verifyOtp: (inputCode: string) => boolean;
|
|
62
|
+
resetPassword: (password: string) => Promise<{
|
|
63
|
+
success: boolean;
|
|
64
|
+
error: string;
|
|
65
|
+
error_type?: undefined;
|
|
66
|
+
} | {
|
|
67
|
+
success: boolean;
|
|
68
|
+
error?: undefined;
|
|
69
|
+
error_type?: undefined;
|
|
70
|
+
} | {
|
|
71
|
+
success: boolean;
|
|
72
|
+
error_type: string | undefined;
|
|
73
|
+
error?: undefined;
|
|
74
|
+
}>;
|
|
75
|
+
resendOtp: () => Promise<{
|
|
76
|
+
success: boolean;
|
|
77
|
+
error: string;
|
|
78
|
+
cooldown?: undefined;
|
|
79
|
+
error_type?: undefined;
|
|
80
|
+
} | {
|
|
81
|
+
success: boolean;
|
|
82
|
+
cooldown: number | undefined;
|
|
83
|
+
error?: undefined;
|
|
84
|
+
error_type?: undefined;
|
|
85
|
+
} | {
|
|
86
|
+
success: boolean;
|
|
87
|
+
error_type: string | undefined;
|
|
88
|
+
error?: undefined;
|
|
89
|
+
cooldown?: undefined;
|
|
90
|
+
}>;
|
|
91
|
+
reset: () => void;
|
|
92
|
+
clearError: () => void;
|
|
93
|
+
};
|
|
94
|
+
export default useMobilePassword;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook d'inscription Mobile SSO v1.0
|
|
3
|
+
* Gère le flow: init → verify-otp → complete
|
|
4
|
+
*
|
|
5
|
+
* @version 1.0.0
|
|
6
|
+
*/
|
|
7
|
+
import type { MobileRegistrationFormData, AccountType } from '../types/mobile';
|
|
8
|
+
interface RegistrationConflict {
|
|
9
|
+
type: 'email' | 'phone';
|
|
10
|
+
masked_identifier: string;
|
|
11
|
+
options: {
|
|
12
|
+
can_login: boolean;
|
|
13
|
+
can_recover_by_email: boolean;
|
|
14
|
+
can_recover_by_sms: boolean;
|
|
15
|
+
masked_email?: string;
|
|
16
|
+
masked_phone?: string;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export interface UseMobileRegistrationOptions {
|
|
20
|
+
saasApiUrl: string;
|
|
21
|
+
iamApiUrl: string;
|
|
22
|
+
debug?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare function useMobileRegistration(options?: UseMobileRegistrationOptions): {
|
|
25
|
+
processToken: string | null;
|
|
26
|
+
status: "pending_password" | "pending_otp" | "pending_registration" | "completed" | "idle";
|
|
27
|
+
formData: Partial<MobileRegistrationFormData>;
|
|
28
|
+
loading: boolean;
|
|
29
|
+
error: string | null;
|
|
30
|
+
conflict: RegistrationConflict | null;
|
|
31
|
+
isCompleted: boolean;
|
|
32
|
+
hasConflict: boolean;
|
|
33
|
+
accountType: AccountType;
|
|
34
|
+
setAccountType: import("react").Dispatch<import("react").SetStateAction<AccountType>>;
|
|
35
|
+
isPhoneOnly: boolean;
|
|
36
|
+
updateFormData: (data: Partial<MobileRegistrationFormData>) => void;
|
|
37
|
+
initRegistration: (data: Omit<MobileRegistrationFormData, "password" | "password_confirmation">) => Promise<{
|
|
38
|
+
success: boolean;
|
|
39
|
+
otp_code_dev: string | undefined;
|
|
40
|
+
otp_method: "email" | "sms" | undefined;
|
|
41
|
+
otp_sent_to: string | undefined;
|
|
42
|
+
error_type?: undefined;
|
|
43
|
+
} | {
|
|
44
|
+
success: boolean;
|
|
45
|
+
error_type: string | undefined;
|
|
46
|
+
otp_code_dev?: undefined;
|
|
47
|
+
otp_method?: undefined;
|
|
48
|
+
otp_sent_to?: undefined;
|
|
49
|
+
} | {
|
|
50
|
+
success: boolean;
|
|
51
|
+
otp_code_dev?: undefined;
|
|
52
|
+
otp_method?: undefined;
|
|
53
|
+
otp_sent_to?: undefined;
|
|
54
|
+
error_type?: undefined;
|
|
55
|
+
}>;
|
|
56
|
+
verifyOtp: (otpCode: string) => Promise<{
|
|
57
|
+
success: boolean;
|
|
58
|
+
error: string;
|
|
59
|
+
completed?: undefined;
|
|
60
|
+
callback_token?: undefined;
|
|
61
|
+
error_type?: undefined;
|
|
62
|
+
} | {
|
|
63
|
+
success: boolean;
|
|
64
|
+
completed: boolean;
|
|
65
|
+
callback_token: string;
|
|
66
|
+
error?: undefined;
|
|
67
|
+
error_type?: undefined;
|
|
68
|
+
} | {
|
|
69
|
+
success: boolean;
|
|
70
|
+
completed: boolean;
|
|
71
|
+
error?: undefined;
|
|
72
|
+
callback_token?: undefined;
|
|
73
|
+
error_type?: undefined;
|
|
74
|
+
} | {
|
|
75
|
+
success: boolean;
|
|
76
|
+
error_type: string | undefined;
|
|
77
|
+
error?: undefined;
|
|
78
|
+
completed?: undefined;
|
|
79
|
+
callback_token?: undefined;
|
|
80
|
+
} | {
|
|
81
|
+
success: boolean;
|
|
82
|
+
error?: undefined;
|
|
83
|
+
completed?: undefined;
|
|
84
|
+
callback_token?: undefined;
|
|
85
|
+
error_type?: undefined;
|
|
86
|
+
}>;
|
|
87
|
+
completeRegistration: (password: string) => Promise<{
|
|
88
|
+
success: boolean;
|
|
89
|
+
error: string;
|
|
90
|
+
callback_token?: undefined;
|
|
91
|
+
error_type?: undefined;
|
|
92
|
+
} | {
|
|
93
|
+
success: boolean;
|
|
94
|
+
callback_token: string;
|
|
95
|
+
error?: undefined;
|
|
96
|
+
error_type?: undefined;
|
|
97
|
+
} | {
|
|
98
|
+
success: boolean;
|
|
99
|
+
error_type: string | undefined;
|
|
100
|
+
error?: undefined;
|
|
101
|
+
callback_token?: undefined;
|
|
102
|
+
} | {
|
|
103
|
+
success: boolean;
|
|
104
|
+
error?: undefined;
|
|
105
|
+
callback_token?: undefined;
|
|
106
|
+
error_type?: undefined;
|
|
107
|
+
}>;
|
|
108
|
+
completePhoneOnlyRegistration: () => Promise<{
|
|
109
|
+
success: boolean;
|
|
110
|
+
error: string;
|
|
111
|
+
callback_token?: undefined;
|
|
112
|
+
error_type?: undefined;
|
|
113
|
+
} | {
|
|
114
|
+
success: boolean;
|
|
115
|
+
callback_token: string;
|
|
116
|
+
error?: undefined;
|
|
117
|
+
error_type?: undefined;
|
|
118
|
+
} | {
|
|
119
|
+
success: boolean;
|
|
120
|
+
error_type: string | undefined;
|
|
121
|
+
error?: undefined;
|
|
122
|
+
callback_token?: undefined;
|
|
123
|
+
} | {
|
|
124
|
+
success: boolean;
|
|
125
|
+
error?: undefined;
|
|
126
|
+
callback_token?: undefined;
|
|
127
|
+
error_type?: undefined;
|
|
128
|
+
}>;
|
|
129
|
+
resendOtp: () => Promise<{
|
|
130
|
+
success: boolean;
|
|
131
|
+
error: string;
|
|
132
|
+
cooldown?: undefined;
|
|
133
|
+
otp_code_dev?: undefined;
|
|
134
|
+
} | {
|
|
135
|
+
success: boolean;
|
|
136
|
+
cooldown: number | undefined;
|
|
137
|
+
otp_code_dev: string | undefined;
|
|
138
|
+
error?: undefined;
|
|
139
|
+
} | {
|
|
140
|
+
success: boolean;
|
|
141
|
+
error?: undefined;
|
|
142
|
+
cooldown?: undefined;
|
|
143
|
+
otp_code_dev?: undefined;
|
|
144
|
+
}>;
|
|
145
|
+
reset: () => void;
|
|
146
|
+
clearError: () => void;
|
|
147
|
+
};
|
|
148
|
+
export default useMobileRegistration;
|