@djangocfg/api 2.1.422 → 2.1.424
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/auth.cjs +3 -15
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +0 -7
- package/dist/auth.d.ts +0 -7
- package/dist/auth.mjs +3 -15
- package/dist/auth.mjs.map +1 -1
- package/package.json +2 -2
- package/src/auth/__tests__/useAuthForm.2fa.test.ts +10 -84
- package/src/auth/hooks/useAuthForm.ts +5 -18
- package/src/auth/types/form.ts +0 -7
package/dist/auth.cjs
CHANGED
|
@@ -2517,8 +2517,7 @@ var useAuthForm = /* @__PURE__ */ __name((options) => {
|
|
|
2517
2517
|
sourceUrl,
|
|
2518
2518
|
redirectUrl,
|
|
2519
2519
|
requireTermsAcceptance = false,
|
|
2520
|
-
authPath = "/auth"
|
|
2521
|
-
enable2FASetup = true
|
|
2520
|
+
authPath = "/auth"
|
|
2522
2521
|
} = options;
|
|
2523
2522
|
const formState = useAuthFormState();
|
|
2524
2523
|
const validation = useAuthValidation();
|
|
@@ -2654,18 +2653,7 @@ var useAuthForm = /* @__PURE__ */ __name((options) => {
|
|
|
2654
2653
|
}
|
|
2655
2654
|
if (result.success) {
|
|
2656
2655
|
saveIdentifierToStorage(submitIdentifier);
|
|
2657
|
-
|
|
2658
|
-
authLogger.info("OTP verification successful, prompting 2FA setup");
|
|
2659
|
-
setShouldPrompt2FA(true);
|
|
2660
|
-
setStep("2fa-setup");
|
|
2661
|
-
onOTPSuccess?.();
|
|
2662
|
-
return true;
|
|
2663
|
-
}
|
|
2664
|
-
if (result.should_prompt_2fa && !enable2FASetup) {
|
|
2665
|
-
authLogger.info("OTP verification successful, skipping 2FA setup prompt (disabled)");
|
|
2666
|
-
} else {
|
|
2667
|
-
authLogger.info("OTP verification successful, showing success screen");
|
|
2668
|
-
}
|
|
2656
|
+
authLogger.info("OTP verification successful, showing success screen");
|
|
2669
2657
|
setStep("success");
|
|
2670
2658
|
onOTPSuccess?.();
|
|
2671
2659
|
return true;
|
|
@@ -2682,7 +2670,7 @@ var useAuthForm = /* @__PURE__ */ __name((options) => {
|
|
|
2682
2670
|
} finally {
|
|
2683
2671
|
setIsLoading(false);
|
|
2684
2672
|
}
|
|
2685
|
-
}, [verifyOTP, saveIdentifierToStorage, setError, setIsLoading, clearError, onOTPSuccess, onError, sourceUrl, redirectUrl, setTwoFactorSessionId, setShouldPrompt2FA, setStep
|
|
2673
|
+
}, [verifyOTP, saveIdentifierToStorage, setError, setIsLoading, clearError, onOTPSuccess, onError, sourceUrl, redirectUrl, setTwoFactorSessionId, setShouldPrompt2FA, setStep]);
|
|
2686
2674
|
const handleOTPSubmit = (0, import_react7.useCallback)(async (e) => {
|
|
2687
2675
|
e.preventDefault();
|
|
2688
2676
|
await submitOTP(identifier, otp);
|