diff --git a/packages/backend/src/server/api/private/verify-email.ts b/packages/backend/src/server/api/private/verify-email.ts index a5cc8d0a0..e6c8295d1 100644 --- a/packages/backend/src/server/api/private/verify-email.ts +++ b/packages/backend/src/server/api/private/verify-email.ts @@ -7,9 +7,7 @@ export default async (ctx: Koa.Context) => { const code = body["code"]; - const profile = await UserProfiles.findOneBy({ - emailVerifyCode: ctx.params.code, - }); + const profile = await UserProfiles.findOneByOrFail({ emailVerifyCode: code }); if (profile != null) { ctx.body = "Verify succeeded!";