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 { error, confirmedEmail } = match.params;
|
||||||
|
|
||||||
const oAuthLogin = async (profile) => {
|
const oAuthLogin = async (profile) => {
|
||||||
await thirdPartyLogin(profile)
|
try {
|
||||||
.then(() => {
|
await thirdPartyLogin(profile);
|
||||||
const redirectPath = localStorage.getItem("redirectPath");
|
|
||||||
|
|
||||||
if (redirectPath) {
|
const redirectPath = localStorage.getItem("redirectPath");
|
||||||
localStorage.removeItem("redirectPath");
|
|
||||||
window.location.href = redirectPath;
|
if (redirectPath) {
|
||||||
}
|
localStorage.removeItem("redirectPath");
|
||||||
})
|
window.location.href = redirectPath;
|
||||||
.catch(() => {
|
}
|
||||||
toastr.error(
|
}
|
||||||
t("Common:ProviderNotConnected"),
|
catch(e) {
|
||||||
t("Common:ProviderLoginError")
|
toastr.error(
|
||||||
);
|
t("Common:ProviderNotConnected"),
|
||||||
})
|
t("Common:ProviderLoginError")
|
||||||
.finally(() => {
|
);
|
||||||
localStorage.removeItem("profile");
|
}
|
||||||
localStorage.removeItem("code");
|
|
||||||
});
|
localStorage.removeItem("profile");
|
||||||
|
localStorage.removeItem("code");
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user