@ollaid/native-sso 2.1.3 → 2.1.5
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 +28 -30
- package/dist/components/DebugPanel.d.ts +1 -1
- package/dist/components/LoginModal.d.ts +1 -1
- package/dist/components/NativeSSOPage.d.ts +1 -1
- package/dist/components/OnboardingModal.d.ts +1 -1
- package/dist/components/PasswordRecoveryModal.d.ts +1 -1
- package/dist/components/SignupModal.d.ts +1 -1
- package/dist/components/ui.d.ts +1 -1
- package/dist/hooks/useLogout.d.ts +1 -1
- package/dist/hooks/useMobilePassword.d.ts +1 -1
- package/dist/hooks/useMobileRegistration.d.ts +1 -1
- package/dist/hooks/useNativeAuth.d.ts +1 -1
- package/dist/hooks/useTokenHealthCheck.d.ts +1 -1
- package/dist/index.cjs +10 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -20
- package/dist/index.js.map +1 -1
- package/dist/provider.d.ts +1 -1
- package/dist/services/api.d.ts +1 -1
- package/dist/services/debugLogger.d.ts +1 -1
- package/dist/services/iamAccount.d.ts +1 -1
- package/dist/services/mobilePassword.d.ts +1 -1
- package/dist/services/mobileRegistration.d.ts +1 -1
- package/dist/services/nativeAuth.d.ts +1 -1
- package/dist/types/mobile.d.ts +1 -1
- package/dist/types/native.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -2527,17 +2527,11 @@ function LoginModal({
|
|
|
2527
2527
|
setPhone(initialPhone);
|
|
2528
2528
|
}
|
|
2529
2529
|
}, [open, initialPhone]);
|
|
2530
|
-
const
|
|
2531
|
-
|
|
2532
|
-
const
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
setLoginSuccess(true);
|
|
2536
|
-
} else {
|
|
2537
|
-
setLocalError("Erreur lors de la finalisation de la connexion");
|
|
2538
|
-
}
|
|
2539
|
-
} catch {
|
|
2540
|
-
setLocalError("Erreur de connexion au serveur");
|
|
2530
|
+
const finalizeLogin = (result) => {
|
|
2531
|
+
if (result.success && result.user) {
|
|
2532
|
+
const token = localStorage.getItem("native_auth_token") || localStorage.getItem("auth_token") || "";
|
|
2533
|
+
setLoginData({ token, user: result.user });
|
|
2534
|
+
setLoginSuccess(true);
|
|
2541
2535
|
}
|
|
2542
2536
|
};
|
|
2543
2537
|
const handleEmailCheck = async () => {
|
|
@@ -2567,7 +2561,7 @@ function LoginModal({
|
|
|
2567
2561
|
return;
|
|
2568
2562
|
}
|
|
2569
2563
|
const result = await submitPassword(password);
|
|
2570
|
-
|
|
2564
|
+
finalizeLogin(result);
|
|
2571
2565
|
};
|
|
2572
2566
|
const handleEmailOtpVerify = async () => {
|
|
2573
2567
|
setLocalError(null);
|
|
@@ -2577,7 +2571,7 @@ function LoginModal({
|
|
|
2577
2571
|
return;
|
|
2578
2572
|
}
|
|
2579
2573
|
const result = await submitOtp(emailOtpCode);
|
|
2580
|
-
|
|
2574
|
+
finalizeLogin(result);
|
|
2581
2575
|
};
|
|
2582
2576
|
const handlePhoneInit = async () => {
|
|
2583
2577
|
setLocalError(null);
|
|
@@ -2597,7 +2591,7 @@ function LoginModal({
|
|
|
2597
2591
|
return;
|
|
2598
2592
|
}
|
|
2599
2593
|
const result = await submitOtp(phoneOtpCode);
|
|
2600
|
-
|
|
2594
|
+
finalizeLogin(result);
|
|
2601
2595
|
};
|
|
2602
2596
|
const handleAccessOtpSubmit = async () => {
|
|
2603
2597
|
setLocalError(null);
|
|
@@ -2607,17 +2601,13 @@ function LoginModal({
|
|
|
2607
2601
|
return;
|
|
2608
2602
|
}
|
|
2609
2603
|
const result = await loginWithAccessOtp(accessOtpCode);
|
|
2610
|
-
|
|
2611
|
-
if (result.callback_token) {
|
|
2612
|
-
await exchangeCallbackToken(result.callback_token);
|
|
2613
|
-
}
|
|
2614
|
-
}
|
|
2604
|
+
finalizeLogin(result);
|
|
2615
2605
|
};
|
|
2616
2606
|
const handleGrantAccess = async () => {
|
|
2617
2607
|
setLocalError(null);
|
|
2618
2608
|
clearError();
|
|
2619
2609
|
const result = await grantAccess();
|
|
2620
|
-
|
|
2610
|
+
finalizeLogin(result);
|
|
2621
2611
|
};
|
|
2622
2612
|
const handleResendOTP = async () => {
|
|
2623
2613
|
if (resendCooldown > 0) return;
|