refreshing after authentication changes. closes #2438

This commit is contained in:
Miodec 2022-02-08 19:41:28 +01:00
parent 73c5b291d8
commit c4e62dddfb
2 changed files with 15 additions and 3 deletions

View file

@ -869,8 +869,11 @@ $(".pageSettings #passPasswordAuth").on("click", (e) => {
SimplePopups.list.updatePassword.show();
});
$(".pageSettings #addGoogleAuth").on("click", (e) => {
AccountController.addGoogleAuth();
$(".pageSettings #addGoogleAuth").on("click", async (e) => {
await AccountController.addGoogleAuth();
setTimeout(() => {
window.location.reload();
}, 1000);
});
$(".pageSettings #removeGoogleAuth").on("click", (e) => {

View file

@ -231,6 +231,9 @@ list.updateEmail = new SimplePopup(
return;
} else {
Notifications.add("Email updated", 1);
setTimeout(() => {
window.location.reload();
}, 1000);
}
} catch (e) {
if (e.code == "auth/wrong-password") {
@ -372,6 +375,9 @@ list.updatePassword = new SimplePopup(
await user.updatePassword(newPass);
Loader.hide();
Notifications.add("Password updated", 1);
setTimeout(() => {
window.location.reload();
}, 1000);
} catch (e) {
Loader.hide();
if (e.code == "auth/wrong-password") {
@ -430,7 +436,10 @@ list.addPasswordAuth = new SimplePopup(
return;
}
AccountController.addPasswordAuth(email, pass);
await AccountController.addPasswordAuth(email, pass);
setTimeout(() => {
window.location.reload();
}, 1000);
},
() => {}
);