@truworth/twc-auth 1.2.2 → 1.2.4
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/build/assets/loading-spinner.json +1 -0
- package/build/src/api/auth.js +36 -0
- package/build/src/components/PasswordCriteria/hooks/usePasswordCriteria.js +1 -8
- package/build/src/components/PasswordCriteria/index.native.js +3 -3
- package/build/src/components/ScreenLayout/index.native.js +2 -2
- package/build/src/components/{EmailOTPVerify → VerifyEmailOTP}/index.js +2 -2
- package/build/src/components/VerifyEmailOTP/index.native.js +22 -0
- package/build/src/components/{VerifyOTP → VerifyMobileOTP}/index.js +2 -2
- package/build/src/components/{VerifyOTP → VerifyMobileOTP}/index.native.js +2 -2
- package/build/src/constants/defaultPolicy.js +9 -0
- package/build/src/contexts/AuthContext.js +1 -1
- package/build/src/enums/index.js +2 -0
- package/build/src/enums/loginMethod.enum.js +8 -0
- package/build/src/enums/registrationMethod.enum.js +7 -0
- package/build/src/helpers/Network.js +1 -1
- package/build/src/helpers/show-message/index.js +2 -2
- package/build/src/helpers/show-message/index.native.js +1 -1
- package/build/src/hooks/useRequest.js +1 -1
- package/build/src/index.js +3 -2
- package/build/src/navigator/index.native.js +8 -1
- package/build/src/screens/CreatePassword/hooks/internal/useCreatePassword.js +2 -15
- package/build/src/screens/EnterEmail/hooks/internal/useEnterEmail.js +22 -40
- package/build/src/screens/EnterEmail/index.js +7 -9
- package/build/src/screens/EnterEmail/index.native.js +11 -11
- package/build/src/screens/EnterEmail/types.js +1 -0
- package/build/src/screens/EnterPassword/index.js +25 -9
- package/build/src/screens/EnterPassword/index.native.js +28 -16
- package/build/src/screens/Login/components/LoginWebComponent/index.js +21 -4
- package/build/src/screens/LoginWithEmailOTP/hooks/internal/useLoginWithEmailOTP.js +72 -0
- package/build/src/screens/LoginWithEmailOTP/index.js +8 -0
- package/build/src/screens/LoginWithEmailOTP/index.native.js +10 -0
- package/build/src/screens/ResetPassword/hooks/internal/useResetPassword.js +55 -0
- package/build/src/screens/ResetPassword/index.js +46 -0
- package/build/src/screens/ResetPassword/index.native.js +26 -0
- package/build/src/screens/ResetPassword/types.js +1 -0
- package/build/src/screens/SSOLogin/AuthWebView/index.js +9 -0
- package/build/src/screens/SSOLogin/AuthWebView/index.native.js +27 -0
- package/build/src/screens/SSOLogin/AuthWebView/types.js +1 -0
- package/build/src/screens/SSOLogin/AuthenticationMethods/hooks/internal/useSSOAuthenticationMethods.js +38 -0
- package/build/src/screens/SSOLogin/AuthenticationMethods/index.js +48 -0
- package/build/src/screens/SSOLogin/AuthenticationMethods/index.native.js +58 -0
- package/build/src/screens/SSOLogin/AuthenticationMethods/types.js +1 -0
- package/build/src/screens/SSOLogin/SSOCallback/components/SSOCallbackComponent/index.js +59 -0
- package/build/src/screens/SSOLogin/SSOCallback/components/SSOCallbackComponent/index.native.js +6 -0
- package/build/src/screens/SSOLogin/SSOCallback/hooks/internal/useSSOCallback.js +42 -0
- package/build/src/screens/SSOLogin/SSOCallback/index.js +9 -0
- package/build/src/screens/SSOLogin/SSOCallback/index.native.js +35 -0
- package/build/src/screens/SSOLogin/SSOCallback/types.js +1 -0
- package/build/src/screens/SSOLogin/SearchOrganization/hooks/internal/useSSOSearchOrganization.js +71 -0
- package/build/src/screens/SSOLogin/SearchOrganization/index.js +46 -0
- package/build/src/screens/SSOLogin/SearchOrganization/index.native.js +37 -0
- package/build/src/screens/SSOLogin/SearchOrganization/types.js +1 -0
- package/build/src/screens/SignUp/components/SignUpForm/index.js +92 -66
- package/build/src/screens/SignUp/components/SignUpWebComponent/index.js +22 -53
- package/build/src/screens/SignUp/hooks/internal/useSignUp.js +77 -81
- package/build/src/screens/SignUp/index.native.js +76 -77
- package/build/src/screens/UserConsent/hooks/internal/useConsent.js +11 -4
- package/build/src/screens/UserConsent/index.js +38 -18
- package/build/src/screens/UserConsent/index.native.js +1 -1
- package/build/src/screens/VerifyEmail/hooks/internal/useVerifyEmail.js +3 -3
- package/build/src/screens/VerifyEmail/index.js +2 -2
- package/build/src/screens/VerifyEmail/index.native.js +2 -2
- package/build/src/screens/VerifyMobile/hooks/internal/useVerifyMobile.js +7 -7
- package/build/src/screens/VerifyMobile/index.js +2 -2
- package/build/src/screens/VerifyMobile/index.native.js +2 -2
- package/build/src/screens/VerifyResetPasswordOTP/hooks/internal/useVerifyResetPasswordOTP.js +74 -0
- package/build/src/screens/VerifyResetPasswordOTP/index.js +8 -0
- package/build/src/screens/VerifyResetPasswordOTP/index.native.js +14 -0
- package/build/src/screens/Welcome/index.js +2 -3
- package/build/src/screens/Welcome/index.native.js +1 -1
- package/build/src/types/types.js +2 -1
- package/build/types/api/auth.d.ts +11 -0
- package/build/types/components/PasswordCriteria/hooks/usePasswordCriteria.d.ts +2 -7
- package/build/types/components/ScreenLayout/index.native.d.ts +1 -1
- package/build/types/components/ScreenLayout/types.d.ts +1 -0
- package/build/types/components/VerifyEmailOTP/index.d.ts +3 -0
- package/build/types/components/VerifyEmailOTP/index.native.d.ts +3 -0
- package/build/types/components/{EmailOTPVerify/type.d.ts → VerifyEmailOTP/types.d.ts} +2 -2
- package/build/types/components/VerifyMobileOTP/index.d.ts +3 -0
- package/build/types/components/VerifyMobileOTP/index.native.d.ts +3 -0
- package/build/types/constants/defaultPolicy.d.ts +9 -0
- package/build/types/enums/index.d.ts +2 -0
- package/build/types/enums/loginMethod.enum.d.ts +7 -0
- package/build/types/enums/registrationMethod.enum.d.ts +6 -0
- package/build/types/helpers/show-message/index.d.ts +2 -2
- package/build/types/helpers/show-message/index.native.d.ts +2 -2
- package/build/types/helpers/show-message/types.d.ts +6 -2
- package/build/types/index.d.ts +3 -2
- package/build/types/navigator/index.native.d.ts +24 -1
- package/build/types/screens/EnterEmail/hooks/internal/useEnterEmail.d.ts +3 -4
- package/build/types/screens/EnterEmail/index.d.ts +2 -6
- package/build/types/screens/EnterEmail/types.d.ts +8 -0
- package/build/types/screens/EnterPassword/index.d.ts +1 -1
- package/build/types/screens/EnterPassword/index.native.d.ts +1 -1
- package/build/types/screens/EnterPassword/types.d.ts +17 -1
- package/build/types/screens/LoginWithEmailOTP/hooks/internal/useLoginWithEmailOTP.d.ts +14 -0
- package/build/types/screens/LoginWithEmailOTP/index.d.ts +4 -0
- package/build/types/screens/LoginWithEmailOTP/index.native.d.ts +4 -0
- package/build/types/screens/ResetPassword/hooks/internal/useResetPassword.d.ts +28 -0
- package/build/types/screens/ResetPassword/index.d.ts +3 -0
- package/build/types/screens/ResetPassword/index.native.d.ts +4 -0
- package/build/types/screens/ResetPassword/types.d.ts +11 -0
- package/build/types/screens/SSOLogin/AuthWebView/index.d.ts +2 -0
- package/build/types/screens/SSOLogin/AuthWebView/index.native.d.ts +4 -0
- package/build/types/screens/SSOLogin/AuthWebView/types.d.ts +8 -0
- package/build/types/screens/SSOLogin/AuthenticationMethods/hooks/internal/useSSOAuthenticationMethods.d.ts +9 -0
- package/build/types/screens/SSOLogin/AuthenticationMethods/index.d.ts +3 -0
- package/build/types/screens/SSOLogin/AuthenticationMethods/index.native.d.ts +4 -0
- package/build/types/screens/SSOLogin/AuthenticationMethods/types.d.ts +11 -0
- package/build/types/screens/SSOLogin/SSOCallback/components/SSOCallbackComponent/index.d.ts +2 -0
- package/build/types/screens/SSOLogin/SSOCallback/components/SSOCallbackComponent/index.native.d.ts +2 -0
- package/build/types/screens/SSOLogin/SSOCallback/hooks/internal/useSSOCallback.d.ts +11 -0
- package/build/types/screens/SSOLogin/SSOCallback/index.d.ts +2 -0
- package/build/types/screens/SSOLogin/SSOCallback/index.native.d.ts +4 -0
- package/build/types/screens/SSOLogin/SSOCallback/types.d.ts +11 -0
- package/build/types/screens/SSOLogin/SearchOrganization/hooks/internal/useSSOSearchOrganization.d.ts +18 -0
- package/build/types/screens/SSOLogin/SearchOrganization/index.d.ts +3 -0
- package/build/types/screens/SSOLogin/SearchOrganization/index.native.d.ts +4 -0
- package/build/types/screens/SSOLogin/SearchOrganization/types.d.ts +13 -0
- package/build/types/screens/SignUp/components/SignUpForm/index.d.ts +1 -1
- package/build/types/screens/SignUp/components/SignUpForm/type.d.ts +1 -4
- package/build/types/screens/SignUp/components/SignUpWebComponent/types.d.ts +1 -16
- package/build/types/screens/SignUp/hooks/internal/useSignUp.d.ts +16 -18
- package/build/types/screens/SignUp/types.d.ts +29 -7
- package/build/types/screens/UserConsent/hooks/internal/useConsent.d.ts +1 -1
- package/build/types/screens/UserConsent/index.d.ts +1 -1
- package/build/types/screens/UserConsent/types.d.ts +19 -13
- package/build/types/screens/VerifyResetPasswordOTP/hooks/internal/useVerifyResetPasswordOTP.d.ts +19 -0
- package/build/types/screens/VerifyResetPasswordOTP/index.d.ts +7 -0
- package/build/types/screens/VerifyResetPasswordOTP/index.native.d.ts +4 -0
- package/build/types/types/types.d.ts +24 -2
- package/package.json +7 -5
- package/build/src/components/EmailOTPVerify/index.native.js +0 -26
- package/build/types/components/EmailOTPVerify/index.d.ts +0 -3
- package/build/types/components/EmailOTPVerify/index.native.d.ts +0 -3
- package/build/types/components/VerifyOTP/index.d.ts +0 -3
- package/build/types/components/VerifyOTP/index.native.d.ts +0 -3
- /package/build/src/components/{VerifyOTP → VerifyEmailOTP}/types.js +0 -0
- /package/build/src/components/{EmailOTPVerify/type.js → VerifyMobileOTP/types.js} +0 -0
- /package/build/types/components/{VerifyOTP → VerifyMobileOTP}/types.d.ts +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { useSSOCallbackProps, SignUpData } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
* Hook for managing SSOCallback screen state and auth context integration.
|
|
5
|
+
* This hook is not exposed to package consumers.
|
|
6
|
+
*/
|
|
7
|
+
declare const useSSOCallback: ({ clientId, code }: useSSOCallbackProps) => {
|
|
8
|
+
result: SignUpData | null;
|
|
9
|
+
error: string | null;
|
|
10
|
+
};
|
|
11
|
+
export { useSSOCallback };
|
package/build/types/screens/SSOLogin/SearchOrganization/hooks/internal/useSSOSearchOrganization.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Client } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
* Hook for managing SSOSearchOrganization screen state and auth context integration.
|
|
5
|
+
* This hook is not exposed to package consumers.
|
|
6
|
+
*/
|
|
7
|
+
declare const useSSOSearchOrganization: () => {
|
|
8
|
+
search: string;
|
|
9
|
+
clientList: Client[];
|
|
10
|
+
searchLoading: boolean;
|
|
11
|
+
noSearchResult: boolean;
|
|
12
|
+
selectedClient: Client | undefined;
|
|
13
|
+
setSearch: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
14
|
+
handleSelect: (client: Client) => void;
|
|
15
|
+
setNoSearchResult: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
16
|
+
setSelectedClient: import("react").Dispatch<import("react").SetStateAction<Client | undefined>>;
|
|
17
|
+
};
|
|
18
|
+
export { useSSOSearchOrganization };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AuthScreensProps } from '../../../navigator/index.native';
|
|
2
|
+
type ScreenProps = AuthScreensProps<'SSOSearchOrganization'>;
|
|
3
|
+
declare const SSOSearchOrganization: ({ navigation }: ScreenProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export default SSOSearchOrganization;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Client } from "../../../types/types";
|
|
2
|
+
interface SSOSearchOrganizationProps {
|
|
3
|
+
onPressBack: () => void;
|
|
4
|
+
onContinue: (client: Client) => void;
|
|
5
|
+
}
|
|
6
|
+
type OptionWithClient = {
|
|
7
|
+
key: string;
|
|
8
|
+
value: string;
|
|
9
|
+
image: string;
|
|
10
|
+
client: Client;
|
|
11
|
+
label: JSX.Element;
|
|
12
|
+
};
|
|
13
|
+
export type { Client, SSOSearchOrganizationProps, OptionWithClient };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { RegistrationFormComponentProps } from "./type";
|
|
2
|
-
declare const SignUpFormComponent: ({
|
|
2
|
+
declare const SignUpFormComponent: ({ userDetails, onContinue }: RegistrationFormComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export { SignUpFormComponent };
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import type { Country,
|
|
1
|
+
import type { Country, PersonalDetails } from "../../../../types/types";
|
|
2
2
|
interface RegistrationFormComponentProps {
|
|
3
|
-
email: string;
|
|
4
|
-
registrationMethod: RegistrationMethod | undefined;
|
|
5
3
|
userDetails: PersonalDetails;
|
|
6
4
|
onContinue: (data: PersonalDetails) => void;
|
|
7
|
-
onGoToLogin: () => void;
|
|
8
5
|
}
|
|
9
6
|
export type { RegistrationFormComponentProps, Country };
|
|
@@ -6,19 +6,4 @@ interface UserDetailsProps {
|
|
|
6
6
|
setValidDetail: (valid: boolean) => void;
|
|
7
7
|
userDetails?: PersonalDetails;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
visible: boolean;
|
|
11
|
-
hide: () => void;
|
|
12
|
-
sessionToken: string;
|
|
13
|
-
phone: string;
|
|
14
|
-
}
|
|
15
|
-
interface VerifyEmailProps {
|
|
16
|
-
visible: boolean;
|
|
17
|
-
hide: () => void;
|
|
18
|
-
sessionToken: string;
|
|
19
|
-
email: string;
|
|
20
|
-
onVerifiedOTP: (params: {
|
|
21
|
-
sessionToken: string;
|
|
22
|
-
}) => void;
|
|
23
|
-
}
|
|
24
|
-
export type { UserDetailsProps, VerifyMobileProps, VerifyEmailProps };
|
|
9
|
+
export type { UserDetailsProps };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import type { InitializeValuesParams, LinkedAccount } from "../../types";
|
|
1
2
|
/**
|
|
2
|
-
* @internal
|
|
3
|
-
* Hook for managing SignUp screen state and auth context integration.
|
|
4
|
-
|
|
5
|
-
*/
|
|
3
|
+
* @internal
|
|
4
|
+
* Hook for managing SignUp screen state and auth context integration.
|
|
5
|
+
*/
|
|
6
6
|
declare const useSignUp: () => {
|
|
7
7
|
loading: boolean;
|
|
8
8
|
firstName: string;
|
|
@@ -27,24 +27,22 @@ declare const useSignUp: () => {
|
|
|
27
27
|
}>>;
|
|
28
28
|
email: string;
|
|
29
29
|
setEmail: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
handleEmail: (text: string) => void;
|
|
41
|
-
handleSubmit: ({ onResult }: {
|
|
42
|
-
onResult: () => void;
|
|
43
|
-
}) => void;
|
|
30
|
+
linkedAccounts: LinkedAccount[];
|
|
31
|
+
linkedAccountsSheet: boolean;
|
|
32
|
+
showLinkedAccountsSheet: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
33
|
+
handleFirstNameChange: (text: string) => void;
|
|
34
|
+
handleLastNameChange: (text: string) => void;
|
|
35
|
+
handleEmailChange: (emailInput: string) => void;
|
|
36
|
+
handleMobileChange: (mobileInput: string) => void;
|
|
37
|
+
handleSubmit: ({ onProceed }: {
|
|
38
|
+
onProceed: () => void;
|
|
39
|
+
}) => Promise<void>;
|
|
44
40
|
getLoginTypeText: (loginType: number) => "Facebook" | "Google" | "Apple" | "Email" | "Microsoft";
|
|
45
41
|
disabled: boolean;
|
|
46
42
|
registrationMethod: import("../../../../types/types").RegistrationMethod;
|
|
43
|
+
onRegistrationMethodChange: (method: import("../../../../types/types").RegistrationMethod) => void;
|
|
47
44
|
appName: string | undefined;
|
|
48
45
|
termsAndConditionsUrl: string | undefined;
|
|
46
|
+
initializeValues: (params: InitializeValuesParams) => void;
|
|
49
47
|
};
|
|
50
48
|
export { useSignUp };
|
|
@@ -7,12 +7,34 @@ interface UseSignUpProps {
|
|
|
7
7
|
}
|
|
8
8
|
interface MobileInputProps {
|
|
9
9
|
phone: string;
|
|
10
|
-
setPhone: (v: string) => void;
|
|
11
10
|
countryCode: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
onChangeCountryCode: () => void;
|
|
12
|
+
onChangeMobile: (v: string) => void;
|
|
13
|
+
onCross: () => void;
|
|
14
|
+
error: {
|
|
15
|
+
show: boolean;
|
|
16
|
+
message: string;
|
|
17
|
+
};
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
+
interface InitializeValuesParams {
|
|
20
|
+
firstName?: string;
|
|
21
|
+
lastName?: string;
|
|
22
|
+
email?: string;
|
|
23
|
+
countryCode?: string;
|
|
24
|
+
}
|
|
25
|
+
interface LinkedAccount {
|
|
26
|
+
memberId: string;
|
|
27
|
+
name: string;
|
|
28
|
+
email: string;
|
|
29
|
+
loginType: number;
|
|
30
|
+
createdOn: string;
|
|
31
|
+
}
|
|
32
|
+
interface LinkedAccountsSheetProps {
|
|
33
|
+
visible: boolean;
|
|
34
|
+
hide: () => void;
|
|
35
|
+
linkedAccounts: LinkedAccount[];
|
|
36
|
+
countryCode: string;
|
|
37
|
+
phone: string;
|
|
38
|
+
getLoginTypeText: (loginType: number) => string;
|
|
39
|
+
}
|
|
40
|
+
export type { UseSignUpProps, MobileInputProps, InitializeValuesParams, LinkedAccount, LinkedAccountsSheetProps };
|
|
@@ -5,6 +5,6 @@ import type { onAgreeHandlerProps } from "../../types";
|
|
|
5
5
|
*/
|
|
6
6
|
declare const useConsent: () => {
|
|
7
7
|
loading: boolean;
|
|
8
|
-
onAgree: ({
|
|
8
|
+
onAgree: ({ userDetails, source, onResult }: onAgreeHandlerProps) => void;
|
|
9
9
|
};
|
|
10
10
|
export { useConsent };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { UserConsentProps } from "./types";
|
|
2
|
-
declare const UserConsent: ({
|
|
2
|
+
declare const UserConsent: ({ userDetails, handleBack }: UserConsentProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default UserConsent;
|
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
import type { MemberProfile, PersonalDetails } from "../../types/types";
|
|
2
2
|
interface UserConsentProps {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
phone: string;
|
|
6
|
-
email: string;
|
|
7
|
-
sessionToken: string;
|
|
8
|
-
}) => void;
|
|
9
|
-
onVerifyMobile: ({ phone, sessionToken }: {
|
|
10
|
-
phone: string;
|
|
11
|
-
sessionToken: string;
|
|
12
|
-
}) => void;
|
|
13
|
-
onBackHandler: () => void;
|
|
3
|
+
userDetails: PersonalDetails;
|
|
4
|
+
handleBack: () => void;
|
|
14
5
|
}
|
|
15
6
|
interface onAgreeHandlerResponse {
|
|
16
7
|
token: string;
|
|
@@ -20,8 +11,23 @@ interface onAgreeHandlerResponse {
|
|
|
20
11
|
sessionToken: string;
|
|
21
12
|
}
|
|
22
13
|
interface onAgreeHandlerProps {
|
|
23
|
-
|
|
14
|
+
userDetails: PersonalDetails;
|
|
24
15
|
source: string;
|
|
25
16
|
onResult: (res: onAgreeHandlerResponse) => void;
|
|
26
17
|
}
|
|
27
|
-
|
|
18
|
+
interface VerifyMobileProps {
|
|
19
|
+
visible: boolean;
|
|
20
|
+
hide: () => void;
|
|
21
|
+
sessionToken: string;
|
|
22
|
+
phone: string;
|
|
23
|
+
}
|
|
24
|
+
interface VerifyEmailProps {
|
|
25
|
+
visible: boolean;
|
|
26
|
+
hide: () => void;
|
|
27
|
+
sessionToken: string;
|
|
28
|
+
email: string;
|
|
29
|
+
onVerifiedOTP: (params: {
|
|
30
|
+
sessionToken: string;
|
|
31
|
+
}) => void;
|
|
32
|
+
}
|
|
33
|
+
export type { UserConsentProps, onAgreeHandlerProps, onAgreeHandlerResponse, VerifyMobileProps, VerifyEmailProps };
|
package/build/types/screens/VerifyResetPasswordOTP/hooks/internal/useVerifyResetPasswordOTP.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
* Hook for managing VerifyResetPasswordOTP screen state and auth context integration.
|
|
4
|
+
* This hook is not exposed to package consumers.
|
|
5
|
+
*/
|
|
6
|
+
declare const useVerifyResetPasswordOTP: ({ email }: {
|
|
7
|
+
email: string;
|
|
8
|
+
}) => {
|
|
9
|
+
status: "loading" | "idle" | "valid" | "invalid";
|
|
10
|
+
resendOTPCounter: number;
|
|
11
|
+
sendOtp: () => void;
|
|
12
|
+
verifyOtp: ({ otp, onVerifiedOTP }: {
|
|
13
|
+
otp: string;
|
|
14
|
+
onVerifiedOTP: (data: {
|
|
15
|
+
sessionToken: string;
|
|
16
|
+
}) => void;
|
|
17
|
+
}) => void;
|
|
18
|
+
};
|
|
19
|
+
export { useVerifyResetPasswordOTP };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AuthScreensProps } from '../../navigator/index.native';
|
|
2
|
+
type ScreenProps = AuthScreensProps<'VerifyResetPasswordOTP'>;
|
|
3
|
+
declare const VerifyResetPasswordOTP: ({ navigation, route }: ScreenProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export default VerifyResetPasswordOTP;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AxiosRequestConfig, AxiosResponseHeaders } from 'axios';
|
|
2
|
-
|
|
2
|
+
import { RegistrationMethod as RegistrationMethodEnum } from '../enums';
|
|
3
|
+
type RegistrationMethod = RegistrationMethodEnum | null;
|
|
3
4
|
interface MemberProfile {
|
|
4
5
|
id?: string;
|
|
5
6
|
email?: string;
|
|
@@ -86,5 +87,26 @@ interface PersonalDetails {
|
|
|
86
87
|
password?: string;
|
|
87
88
|
confirmPassword?: string;
|
|
88
89
|
}
|
|
90
|
+
interface PasswordPolicy {
|
|
91
|
+
minLength: number;
|
|
92
|
+
maxLength?: number;
|
|
93
|
+
numbers: boolean;
|
|
94
|
+
uppercase: boolean;
|
|
95
|
+
lowercase: boolean;
|
|
96
|
+
specialCharacters: boolean;
|
|
97
|
+
}
|
|
98
|
+
interface AuthSettings {
|
|
99
|
+
mobileLoginEnabled: boolean;
|
|
100
|
+
ssoEnabled: boolean;
|
|
101
|
+
}
|
|
102
|
+
interface Client {
|
|
103
|
+
key: string;
|
|
104
|
+
id: number;
|
|
105
|
+
name: string;
|
|
106
|
+
image: string;
|
|
107
|
+
mobileLoginEnabled: boolean;
|
|
108
|
+
ssoEnabled: boolean;
|
|
109
|
+
authSettings: AuthSettings;
|
|
110
|
+
}
|
|
89
111
|
export type UseRequestOptions = BaseRequestOptions;
|
|
90
|
-
export type { RegistrationParams, MemberProfile, ClientProfile, Partner, Profile, Country, RegistrationMethod, PersonalDetails };
|
|
112
|
+
export type { RegistrationParams, MemberProfile, ClientProfile, Partner, Profile, Country, RegistrationMethod, PersonalDetails, PasswordPolicy, Client, AuthSettings };
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"description": "Truworth Auth Package for React Native and Web",
|
|
7
|
-
"version": "1.2.
|
|
7
|
+
"version": "1.2.4",
|
|
8
8
|
"main": "build/src/index.js",
|
|
9
9
|
"types": "build/types/index.d.ts",
|
|
10
10
|
"files": [
|
|
@@ -27,14 +27,15 @@
|
|
|
27
27
|
"@react-navigation/native-stack": "^6.10.0",
|
|
28
28
|
"@truworth/twc-rn-common": "^1.0.15",
|
|
29
29
|
"@truworth/twc-web-common": "^1.0.11",
|
|
30
|
-
"@truworth/twc-web-design": "^1.
|
|
30
|
+
"@truworth/twc-web-design": "^1.10.0",
|
|
31
31
|
"@twotalltotems/react-native-otp-input": "1.3.11",
|
|
32
32
|
"@types/crypto-js": "^4.2.2",
|
|
33
33
|
"@types/fbemitter": "^2.0.35",
|
|
34
34
|
"@types/lodash": "^4.17.15",
|
|
35
35
|
"@types/react": "^18.2.0",
|
|
36
|
-
"@types/react-native": "^0.72.0",
|
|
37
36
|
"@types/react-google-recaptcha": "^2.1.9",
|
|
37
|
+
"@types/react-native": "^0.72.0",
|
|
38
|
+
"@types/url-parse": "^1.4.11",
|
|
38
39
|
"@ui-kitten/components": "^5.1.2",
|
|
39
40
|
"antd": "^5.6.3",
|
|
40
41
|
"copyfiles": "^2.4.1",
|
|
@@ -48,6 +49,7 @@
|
|
|
48
49
|
"next": "^15.0.4",
|
|
49
50
|
"react": "^18.2.0",
|
|
50
51
|
"react-dom": "^18.2.0",
|
|
52
|
+
"react-google-recaptcha": "^3.1.0",
|
|
51
53
|
"react-infinite-scroll-component": "^6.1.0",
|
|
52
54
|
"react-lottie": "^1.2.3",
|
|
53
55
|
"react-native": "^0.74.5",
|
|
@@ -62,11 +64,11 @@
|
|
|
62
64
|
"react-native-safe-area-context": "^5.3.0",
|
|
63
65
|
"react-native-svg": "15.8.0",
|
|
64
66
|
"react-native-svg-uri": "^1.2.3",
|
|
65
|
-
"react-google-recaptcha": "^3.1.0",
|
|
66
67
|
"react-native-vector-icons": "^9.2.0",
|
|
67
68
|
"react-redux": "^9.2.0",
|
|
68
69
|
"sweetalert2": "^11.23.0",
|
|
69
|
-
"typescript": "^5.0.0"
|
|
70
|
+
"typescript": "^5.0.0",
|
|
71
|
+
"url-parse": "^1.5.10"
|
|
70
72
|
},
|
|
71
73
|
"peerDependencies": {
|
|
72
74
|
"@react-google-maps/api": ">=2.20.6",
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import { Dimensions, Platform, ScrollView, Text, TouchableOpacity, View } from "react-native";
|
|
4
|
-
import { Layout } from "@ui-kitten/components";
|
|
5
|
-
import { Header, Colors, CustomKeyboardAvoidingView } from "@truworth/twc-rn-common";
|
|
6
|
-
import { ScreenLayout } from "../ScreenLayout";
|
|
7
|
-
import { OTPStatusLabel } from "../OTPStatusLabel/index.native";
|
|
8
|
-
import OTPInputView from "@twotalltotems/react-native-otp-input";
|
|
9
|
-
const EmailOTPVerify = ({ status, validateOTP, resendOTP, resendOTPCounter, email }) => {
|
|
10
|
-
const [otp, setOTP] = useState('');
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
if (otp && otp.length === 6) {
|
|
13
|
-
validateOTP?.(otp);
|
|
14
|
-
}
|
|
15
|
-
}, [otp]);
|
|
16
|
-
return (_jsxs(Layout, { style: { flex: 1, backgroundColor: '#fff' }, children: [_jsx(Header, {}), _jsxs(CustomKeyboardAvoidingView, { behavior: Platform.OS === 'ios' ? 'padding' : undefined, keyboardVerticalOffset: Platform.OS === 'ios' ? 100 : 0, children: [_jsx(ScrollView, { showsVerticalScrollIndicator: false, children: _jsxs(ScreenLayout, { hideHeader: true, title: _jsxs(_Fragment, { children: ["OTP sent to ", '\n', _jsx(Text, { style: { fontSize: 20 }, children: email })] }), children: [_jsx(View, { style: { justifyContent: 'center', flexDirection: 'row', marginBottom: 30, position: 'relative' }, children: _jsx(OTPInputView, { pinCount: 6, autoFocusOnLoad: false, codeInputFieldStyle: {
|
|
17
|
-
fontSize: 20, color: 'black',
|
|
18
|
-
height: 45, width: 30,
|
|
19
|
-
borderWidth: 0, borderBottomWidth: 1,
|
|
20
|
-
}, codeInputHighlightStyle: { borderColor: '#03DAC6' }, style: {
|
|
21
|
-
height: 50,
|
|
22
|
-
width: Dimensions.get('window').width - 100,
|
|
23
|
-
}, onCodeFilled: code => setOTP(code) }) }), resendOTPCounter < 3 &&
|
|
24
|
-
_jsxs(View, { style: { flexDirection: 'row', alignItems: 'center' }, children: [_jsxs(Text, { style: { fontSize: 14, fontWeight: '500', color: Colors.gray.gray_400, lineHeight: 20 }, children: ["Did not receive OTP?", ' '] }), _jsx(TouchableOpacity, { activeOpacity: 0.8, onPress: resendOTP, children: _jsx(Text, { style: { fontSize: 14, fontWeight: '500', color: '#2cbaa4', lineHeight: 20 }, children: "Re-send OTP" }) })] })] }) }), _jsx(View, { style: { alignSelf: 'flex-end', width: '100%' }, children: _jsx(OTPStatusLabel, { status: status }) })] })] }));
|
|
25
|
-
};
|
|
26
|
-
export { EmailOTPVerify };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|