Web: Refactoring asyn/promise calls

This commit is contained in:
Alexey Safronov 2021-11-03 18:35:15 +03:00 committed by GitHub
parent 5d953407ad
commit baccb134a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -187,25 +187,25 @@ const Form = (props) => {
const { error, confirmedEmail } = match.params;
const oAuthLogin = async (profile) => {
await thirdPartyLogin(profile)
.then(() => {
try {
await thirdPartyLogin(profile);
const redirectPath = localStorage.getItem("redirectPath");
if (redirectPath) {
localStorage.removeItem("redirectPath");
window.location.href = redirectPath;
}
})
.catch(() => {
}
catch(e) {
toastr.error(
t("Common:ProviderNotConnected"),
t("Common:ProviderLoginError")
);
})
.finally(() => {
}
localStorage.removeItem("profile");
localStorage.removeItem("code");
});
};
useEffect(() => {