@opexa/portal-components 0.1.30 → 0.1.32

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.
@@ -21,7 +21,10 @@ export const useSignInMutation = (options) => {
21
21
  const token = recaptcha.reCaptchaKey
22
22
  ? await recaptcha.executeRecaptcha('submit')
23
23
  : null;
24
- const fingerprint = versionSession === 'Inplay' ? await getFingerprint() : null;
24
+ const isInplayEligible = input.type === 'NAME_AND_PASSWORD' || input.type === 'MOBILE_NUMBER';
25
+ const fingerprint = versionSession === 'Inplay' && isInplayEligible
26
+ ? await getFingerprint()
27
+ : null;
25
28
  const signInOnce = () => signIn(input, {
26
29
  headers: {
27
30
  ...(token && {
@@ -38,7 +41,7 @@ export const useSignInMutation = (options) => {
38
41
  : { Channel: 'IOS' }),
39
42
  },
40
43
  }, versionSession);
41
- const authenticator = versionSession === 'Inplay' && input.type === 'NAME_AND_PASSWORD'
44
+ const authenticator = versionSession === 'Inplay' && isInplayEligible
42
45
  ? await pollSignIn(signInOnce)
43
46
  : await signInOnce();
44
47
  if (!authenticator) {
@@ -44,6 +44,15 @@ export function KycOpenOnHomeMount({ isSkippable, bypassKycCheck, enablePendingK
44
44
  }
45
45
  return;
46
46
  }
47
+ if (isVerificationLocked) {
48
+ if (isKycOpen && !isKycReminderOpen) {
49
+ return;
50
+ }
51
+ setkycOpen(false);
52
+ setkycAccountVerificationRequired(false);
53
+ setkycReminderOpen(true);
54
+ return;
55
+ }
47
56
  // If a resubmission is already pending review, do not re-open KYC.
48
57
  if (isPending) {
49
58
  setkycOpen(false);
@@ -45,7 +45,7 @@ export function MobileNumberSignIn() {
45
45
  disclaimer: ctx.disclaimer,
46
46
  })));
47
47
  const signInMutation = useSignInMutation({
48
- // versionSession intentionally omitted: only applies to NAME_AND_PASSWORD
48
+ versionSession: signInProps.versionSession,
49
49
  onSuccess: async () => {
50
50
  step1Form.reset();
51
51
  step2Form.reset();
@@ -46,7 +46,7 @@ export function MobileNumberSignIn() {
46
46
  disclaimer: ctx.disclaimer,
47
47
  })));
48
48
  const signInMutation = useSignInMutation({
49
- // versionSession intentionally omitted: only applies to NAME_AND_PASSWORD
49
+ versionSession: signInProps.versionSession,
50
50
  onSuccess: async () => {
51
51
  step1Form.reset();
52
52
  step2Form.reset();
@@ -53,7 +53,7 @@ export function MobileNumberSignIn() {
53
53
  termsOfUse: ctx.termsOfUse,
54
54
  })));
55
55
  const signInMutation = useSignInMutation({
56
- // versionSession intentionally omitted: only applies to NAME_AND_PASSWORD
56
+ versionSession: signInProps.versionSession,
57
57
  onSuccess: async () => {
58
58
  step1Form.reset();
59
59
  step2Form.reset();
@@ -81,7 +81,7 @@ export function MobileNumberSignInInternational() {
81
81
  termsOfUse: ctx.termsOfUse,
82
82
  })));
83
83
  const signInMutation = useSignInMutation({
84
- // versionSession intentionally omitted: only applies to NAME_AND_PASSWORD
84
+ versionSession: signInProps.versionSession,
85
85
  onSuccess: async () => {
86
86
  step1Form.reset();
87
87
  step2Form.reset();
@@ -31,10 +31,6 @@ export interface SignInProps extends UseSignInProps {
31
31
  * - `Inplay`: `${AUTH_ENDPOINT}/v3/inplay/sessions`
32
32
  */
33
33
  versionSession?: VersionSession;
34
- /**
35
- * Optional browser fingerprint provider. For Inplay NAME_AND_PASSWORD
36
- * sign-ins, pass `() => sdk.fingerprint()` from the consuming app.
37
- */
38
34
  fingerprint?: () => Promise<string | null> | string | null;
39
35
  }
40
36
  export declare function SignIn(props: SignInProps): import("react/jsx-runtime").JSX.Element;
@@ -25,7 +25,7 @@ export function SignIn(props) {
25
25
  const mutating = useIsMutating({ mutationKey: getSignInMutationKey() }) > 0;
26
26
  const showLoader = mutating &&
27
27
  props.versionSession === 'Inplay' &&
28
- signIn.type === 'NAME_AND_PASSWORD';
28
+ (signIn.type === 'NAME_AND_PASSWORD' || signIn.type === 'MOBILE_NUMBER');
29
29
  return (_jsx(SignInPropsProvider, { value: props, children: _jsx(SignInProvider, { value: signIn, children: _jsx(Dialog.Root, { open: signInStore.open, onOpenChange: (details) => {
30
30
  signInStore.setOpen(details.open);
31
31
  }, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: () => {
@@ -31,16 +31,14 @@ export async function createSession(input, options, versionSession = 'default')
31
31
  new Headers(options?.headers).forEach((value, key) => {
32
32
  headers.set(key, value);
33
33
  });
34
- // `versionSession` only applies to NAME_AND_PASSWORD sign-ins. All other
35
- // auth types (MOBILE_NUMBER, MAYA, SOCIALS, CABINET, SINGLE_USE_TOKEN) are
34
+ // `versionSession` applies to NAME_AND_PASSWORD and MOBILE_NUMBER sign-ins.
35
+ // All other auth types (MAYA, SOCIALS, CABINET, SINGLE_USE_TOKEN) are
36
36
  // forced to the default `/sessions` endpoint.
37
- const effectiveVersionSession = input.type === 'NAME_AND_PASSWORD' ? versionSession : 'default';
38
- // The `Fingerprint` header is only meaningful for the Inplay
39
- // NAME_AND_PASSWORD endpoint (`/v3/inplay/sessions`). Strip it for any
40
- // other combination to avoid leaking it to upstream endpoints that don't
41
- // expect it.
37
+ const effectiveVersionSession = input.type === 'NAME_AND_PASSWORD' || input.type === 'MOBILE_NUMBER'
38
+ ? versionSession
39
+ : 'default';
42
40
  if (effectiveVersionSession !== 'Inplay' ||
43
- input.type !== 'NAME_AND_PASSWORD') {
41
+ (input.type !== 'NAME_AND_PASSWORD' && input.type !== 'MOBILE_NUMBER')) {
44
42
  headers.delete(FINGERPRINT_HEADER_KEY);
45
43
  }
46
44
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.1.30",
3
+ "version": "0.1.32",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",