MCPcopy Index your code
hub / github.com/monkeytypegame/monkeytype / setPersistence

Function setPersistence

frontend/src/ts/firebase.ts:198–215  ·  view source on GitHub ↗
(
  rememberMe: boolean,
  store = false,
)

Source from the content-addressed store, hash-verified

196 return firebaseGetIdToken(user);
197}
198async function setPersistence(
199 rememberMe: boolean,
200 store = false,
201): Promise<void> {
202 if (Auth === undefined) throw new Error("Authentication uninitialized");
203 const persistence = rememberMe
204 ? indexedDBLocalPersistence
205 : browserSessionPersistence;
206
207 if (store) {
208 window.localStorage.setItem(
209 "firebasePersistence",
210 rememberMe ? "LOCAL" : "SESSION",
211 );
212 }
213
214 await firebaseSetPersistence(Auth, persistence);
215}
216
217function translateFirebaseError(
218 error: Error | FirebaseError,

Callers 3

initFunction · 0.85
signInWithPopupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected