diff options
author | Emma [it/its]@Rory& <root@rory.gay> | 2023-12-11 01:12:54 +0100 |
---|---|---|
committer | Emma [it/its]@Rory& <root@rory.gay> | 2023-12-11 01:12:54 +0100 |
commit | 0a8ceb9e6349284e75545a01ffad608b020f78e2 (patch) | |
tree | 17a9163f963eddabf9168b0b630096b2f7535b64 /src/api/routes/auth/forgot.ts | |
parent | Prettier: use editorconfig (diff) | |
download | server-0a8ceb9e6349284e75545a01ffad608b020f78e2.tar.xz |
Actually run prettier dev/emma-refactors
Diffstat (limited to 'src/api/routes/auth/forgot.ts')
-rw-r--r-- | src/api/routes/auth/forgot.ts | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/src/api/routes/auth/forgot.ts b/src/api/routes/auth/forgot.ts index 6fa86021..a17a2936 100644 --- a/src/api/routes/auth/forgot.ts +++ b/src/api/routes/auth/forgot.ts @@ -17,13 +17,7 @@ */ import { getIpAdress, route, verifyCaptcha } from "@spacebar/api"; -import { - Config, - Email, - FieldErrors, - ForgotPasswordSchema, - User, -} from "@spacebar/util"; +import { Config, Email, FieldErrors, ForgotPasswordSchema, User } from "@spacebar/util"; import { Request, Response, Router } from "express"; import { HTTPError } from "lambert-server"; const router = Router(); @@ -47,10 +41,7 @@ router.post( const config = Config.get(); - if ( - config.passwordReset.requireCaptcha && - config.security.captcha.enabled - ) { + if (config.passwordReset.requireCaptcha && config.security.captcha.enabled) { const { sitekey, service } = config.security.captcha; if (!captcha_key) { return res.status(400).json({ @@ -87,8 +78,7 @@ router.post( if (!user.email) throw FieldErrors({ login: { - message: - "This account does not have an email address associated with it.", + message: "This account does not have an email address associated with it.", code: "NO_EMAIL", }, }); @@ -110,12 +100,10 @@ router.post( return res.sendStatus(204); }) .catch((e) => { - console.error( - `Failed to send password reset email to ${user.username}#${user.discriminator}: ${e}`, - ); + console.error(`Failed to send password reset email to ${user.username}#${user.discriminator}: ${e}`); throw new HTTPError("Failed to send password reset email", 500); }); - }, + } ); export default router; |