(email: string)
| 88 | } |
| 89 | |
| 90 | export async function sendForgotPasswordEmail(email: string): Promise<void> { |
| 91 | try { |
| 92 | const uid = (await FirebaseAdmin().auth().getUserByEmail(email)).uid; |
| 93 | const { name } = await UserDAL.getPartialUser( |
| 94 | uid, |
| 95 | "request forgot password email", |
| 96 | ["name"], |
| 97 | ); |
| 98 | |
| 99 | const link = await FirebaseAdmin() |
| 100 | .auth() |
| 101 | .generatePasswordResetLink(email, { url: getFrontendUrl() }); |
| 102 | |
| 103 | await emailQueue.sendForgotPasswordEmail(email, name, link); |
| 104 | } catch (err) { |
| 105 | if (isFirebaseError(err) && err.errorInfo.code !== "auth/user-not-found") { |
| 106 | // oxlint-disable-next-line only-throw-error |
| 107 | throw err; |
| 108 | } |
| 109 | } |
| 110 | } |
nothing calls this directly
no test coverage detected