diff options
author | Puyodead1 <puyodead@proton.me> | 2023-01-30 19:05:22 -0500 |
---|---|---|
committer | Puyodead1 <puyodead@protonmail.com> | 2023-02-23 22:40:05 -0500 |
commit | 34cde14f753feb37a2b1dd2ce772ccc8552b4198 (patch) | |
tree | d863d17934a31c8bffb6425961e049b387b6b2f1 /src/api/routes/auth/verify | |
parent | fix linting errors (diff) | |
download | server-34cde14f753feb37a2b1dd2ce772ccc8552b4198.tar.xz |
config: require account verification
Diffstat (limited to 'src/api/routes/auth/verify')
-rw-r--r-- | src/api/routes/auth/verify/index.ts | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/api/routes/auth/verify/index.ts b/src/api/routes/auth/verify/index.ts index 7809bc26..14cc3f95 100644 --- a/src/api/routes/auth/verify/index.ts +++ b/src/api/routes/auth/verify/index.ts @@ -17,7 +17,7 @@ */ import { route, verifyCaptcha } from "@fosscord/api"; -import { checkToken, Config, FieldErrors } from "@fosscord/util"; +import { checkToken, Config, FieldErrors, User } from "@fosscord/util"; import { Request, Response, Router } from "express"; import { HTTPError } from "lambert-server"; const router = Router(); @@ -57,11 +57,7 @@ router.post( if (user.verified) return res.send(user); - // verify email - user.verified = true; - await user.save(); - - // TODO: invalidate token after use? + await User.update({ id: user.id }, { verified: true }); return res.send(user); } catch (error) { |