migration to postgres

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-26 17:42:59 +00:00
co-authored by Claude Opus 4.6
parent 7f04ecd644
commit 500a70910e
54 changed files with 4016 additions and 264 deletions
+1 -2
View File
@@ -7,13 +7,12 @@ import * as errors from '@@/custom-errors';
import { validatePassword } from './validate-password';
export const resetPasswordHandler: Handler = async function (ctx) {
const now = Date.now().valueOf();
const { password, verificationCode } = ctx.get('body');
validatePassword(password);
const userInfo = (await verify(verificationCode)) as User;
if (!userInfo) throw errors.UNAUTHORIZED();
const passwordHash = await argon2.hash(password);
await updateUser(userInfo.id, { password: passwordHash, status: 'Active', passwordChangedAt: now });
await updateUser(userInfo.id, { password: passwordHash, status: 'Active', passwordChangedAt: new Date() });
return ctx.json({ ok: true });
};