Merge pull request #1889 from Infisical/fix/added-lock-prompt-to-sso-signin

fix: added account locked prompt to sso signin flow
This commit is contained in:
Sheen Capadngan
2024-05-29 01:00:48 +08:00
committed by GitHub
@@ -31,7 +31,6 @@ export const PasswordStep = ({
setPassword, setPassword,
setStep setStep
}: Props) => { }: Props) => {
const [isLoading, setIsLoading] = useState(false); const [isLoading, setIsLoading] = useState(false);
const { t } = useTranslation(); const { t } = useTranslation();
const router = useRouter(); const router = useRouter();
@@ -146,13 +145,23 @@ export const PasswordStep = ({
} }
} }
} }
} catch (err) { } catch (err: any) {
setIsLoading(false); setIsLoading(false);
console.error(err);
if (err.response.data.error === "User Locked") {
createNotification({
title: err.response.data.error,
text: err.response.data.message,
type: "error"
});
return;
}
createNotification({ createNotification({
text: "Login unsuccessful. Double-check your master password and try again.", text: "Login unsuccessful. Double-check your master password and try again.",
type: "error" type: "error"
}); });
console.error(err);
} }
}; };