Web: Refactoring asyn/promise calls
This commit is contained in:
parent
5d953407ad
commit
baccb134a6
@ -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(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user