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

View File

@@ -31,7 +31,6 @@ export const PasswordStep = ({
setPassword,
setStep
}: Props) => {
const [isLoading, setIsLoading] = useState(false);
const { t } = useTranslation();
const router = useRouter();
@@ -146,13 +145,23 @@ export const PasswordStep = ({
}
}
}
} catch (err) {
} catch (err: any) {
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({
text: "Login unsuccessful. Double-check your master password and try again.",
type: "error"
});
console.error(err);
}
};