@opexa/portal-components 0.1.31 → 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.
- package/dist/client/hooks/useSignInMutation.js +5 -2
- package/dist/components/SignIn/CrazyWin/MobileNumberSignIn.js +1 -1
- package/dist/components/SignIn/HappyBingo/MobileNumberSignIn.js +1 -1
- package/dist/components/SignIn/MobileNumberSignIn.js +1 -1
- package/dist/components/SignIn/MobileNumberSignInternational.js +1 -1
- package/dist/components/SignIn/SignIn.lazy.d.ts +0 -4
- package/dist/components/SignIn/SignIn.lazy.js +1 -1
- package/dist/services/auth.js +6 -8
- package/package.json +1 -1
|
@@ -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
|
|
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' &&
|
|
44
|
+
const authenticator = versionSession === 'Inplay' && isInplayEligible
|
|
42
45
|
? await pollSignIn(signInOnce)
|
|
43
46
|
: await signInOnce();
|
|
44
47
|
if (!authenticator) {
|
|
@@ -45,7 +45,7 @@ export function MobileNumberSignIn() {
|
|
|
45
45
|
disclaimer: ctx.disclaimer,
|
|
46
46
|
})));
|
|
47
47
|
const signInMutation = useSignInMutation({
|
|
48
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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: () => {
|
package/dist/services/auth.js
CHANGED
|
@@ -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`
|
|
35
|
-
// auth types (
|
|
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'
|
|
38
|
-
|
|
39
|
-
|
|
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 {
|