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

Function signInWithEmailAndPassword

frontend/src/ts/firebase.ts:115–135  ·  view source on GitHub ↗
(
  email: string,
  password: string,
  rememberMe: boolean,
)

Source from the content-addressed store, hash-verified

113}
114
115export async function signInWithEmailAndPassword(
116 email: string,
117 password: string,
118 rememberMe: boolean,
119): Promise<UserCredential> {
120 if (Auth === undefined) throw new Error("Authentication uninitialized");
121 await setPersistence(rememberMe, true);
122
123 const { data: result, error } = await tryCatch(
124 firebaseSignInWithEmailAndPassword(Auth, email, password),
125 );
126 if (error !== null) {
127 console.error(error);
128 throw translateFirebaseError(
129 error,
130 "Failed to sign in with email and password",
131 );
132 }
133
134 return result;
135}
136
137export function setUserState(
138 options: {

Callers 1

signInFunction · 0.90

Calls 3

tryCatchFunction · 0.90
setPersistenceFunction · 0.85
translateFirebaseErrorFunction · 0.85

Tested by

no test coverage detected