mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-09 13:44:29 +08:00
added protection
This commit is contained in:
parent
cc004de147
commit
d38f739c63
1 changed files with 17 additions and 13 deletions
|
|
@ -404,19 +404,23 @@ export async function addGoogleAuth(): Promise<void> {
|
|||
export function noGoogleNoMo(): void {
|
||||
const user = Auth.currentUser;
|
||||
if (user === null) return;
|
||||
unlinkAuth(user, "google.com")
|
||||
.then(() => {
|
||||
Notifications.add("Google authentication removed", 1);
|
||||
Loader.hide();
|
||||
Settings.updateAuthSections();
|
||||
})
|
||||
.catch((error) => {
|
||||
Loader.hide();
|
||||
Notifications.add(
|
||||
"Failed to remove Google authentication: " + error.message,
|
||||
-1
|
||||
);
|
||||
});
|
||||
if (
|
||||
user.providerData.find((provider) => provider.providerId === "password")
|
||||
) {
|
||||
unlinkAuth(user, "google.com")
|
||||
.then(() => {
|
||||
Notifications.add("Google authentication removed", 1);
|
||||
Loader.hide();
|
||||
Settings.updateAuthSections();
|
||||
})
|
||||
.catch((error) => {
|
||||
Loader.hide();
|
||||
Notifications.add(
|
||||
"Failed to remove Google authentication: " + error.message,
|
||||
-1
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export async function removeGoogleAuth(): Promise<void> {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue