mirror of https://github.com/sylv/micro.git
fix: let otp errors propogate to prevent redirects
This commit is contained in:
parent
126be8d8c6
commit
e56d700d2e
|
@ -56,7 +56,7 @@ export const LoginForm: FC = () => {
|
||||||
|
|
||||||
if (user.otpRequired && loginInfo) {
|
if (user.otpRequired && loginInfo) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className="w-full">
|
||||||
<OtpInput
|
<OtpInput
|
||||||
loading={loggingIn}
|
loading={loggingIn}
|
||||||
invalid={invalidOTP}
|
invalid={invalidOTP}
|
||||||
|
|
|
@ -48,7 +48,6 @@ export const useLoginUser = () => {
|
||||||
} else if (result.error) {
|
} else if (result.error) {
|
||||||
if (result.error.message.toLowerCase().includes('otp')) {
|
if (result.error.message.toLowerCase().includes('otp')) {
|
||||||
setOtp(true);
|
setOtp(true);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
throw result.error;
|
throw result.error;
|
||||||
|
|
Loading…
Reference in New Issue