mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-26 15:54:35 +08:00
added function for users that got stuck with a google account that no longer exists
This commit is contained in:
parent
699ddd8737
commit
cc004de147
3 changed files with 22 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
1
frontend/src/ts/types/types.d.ts
vendored
1
frontend/src/ts/types/types.d.ts
vendored
|
@ -550,6 +550,7 @@ declare namespace MonkeyTypes {
|
|||
getTimerStats(): TimerStats[];
|
||||
toggleUnsmoothedRaw(): void;
|
||||
enableSpacingDebug(): void;
|
||||
noGoogleNoMo(): void;
|
||||
}
|
||||
|
||||
interface GithubRelease {
|
||||
|
|
Loading…
Reference in a new issue