Fix Bug 63407 - Accounts: Two-factor authentication: Authorization through social networks does not work when two-factor authentication is enabled

This commit is contained in:
Ilya Oleshko 2023-08-14 12:46:35 +03:00
parent 012cc69ce0
commit 078073d0df

View File

@ -73,9 +73,15 @@ const LoginForm: React.FC<ILoginFormProps> = ({
thirdPartyLogin(profile)
.then((response) => {
if (!response || !response.token) throw new Error("Empty API response");
if (!(response || response.token || response.confirmUrl))
throw new Error("Empty API response");
setWithCredentialsStatus(true);
if (response.confirmUrl) {
return window.location.replace(response.confirmUrl);
}
const redirectPath = sessionStorage.getItem("referenceUrl");
if (redirectPath) {