added function for users that got stuck with a google account that no longer exists

This commit is contained in:
Miodec 2022-05-13 09:53:12 +02:00
parent 699ddd8737
commit cc004de147
3 changed files with 22 additions and 0 deletions

View file

@ -401,6 +401,24 @@ 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
);
});
}
export async function removeGoogleAuth(): Promise<void> {
const user = Auth.currentUser;
if (user === null) return;

View file

@ -28,6 +28,7 @@ import "./popups/mobile-test-config-popup";
import "./popups/edit-tags-popup";
import "./popups/google-sign-up-popup";
import * as Account from "./pages/account";
import { noGoogleNoMo } from "./controllers/account-controller";
type ExtendedGlobal = typeof globalThis & MonkeyTypes.Global;
@ -52,3 +53,5 @@ extendedGlobal.getTimerStats = TestTimer.getTimerStats;
extendedGlobal.toggleUnsmoothedRaw = Result.toggleUnsmoothedRaw;
extendedGlobal.enableSpacingDebug = TestInput.enableSpacingDebug;
extendedGlobal.noGoogleNoMo = noGoogleNoMo;

View file

@ -550,6 +550,7 @@ declare namespace MonkeyTypes {
getTimerStats(): TimerStats[];
toggleUnsmoothedRaw(): void;
enableSpacingDebug(): void;
noGoogleNoMo(): void;
}
interface GithubRelease {