refactor: use sync bcrypt to avoid issues with worker perms

refactor: fix up includes
This commit is contained in:
Andy Burke 2025-07-24 12:09:24 -07:00
parent e397bc884b
commit 1a02dcfcc3
27 changed files with 104 additions and 178 deletions

View file

@ -1,13 +1,13 @@
import { PASSWORD_ENTRIES } from '../../../models/password_entry.ts';
import { USER, USERS } from '../../../models/user.ts';
import { encodeBase32 } from 'jsr:@std/encoding';
import lurid from 'jsr:@andyburke/lurid';
import { encodeBase32 } from '@std/encoding';
import lurid from '@andyburke/lurid';
import { SESSION, SESSIONS } from '../../../models/session.ts';
import { TOTP_ENTRIES } from '../../../models/totp_entry.ts';
import { encodeBase64 } from 'jsr:@std/encoding/base64';
import { encodeBase64 } from '@std/encoding/base64';
import parse_body from '../../../utils/bodyparser.ts';
import { get_session, get_user, PRECHECK_TABLE, require_user, SESSION_ID_TOKEN, SESSION_SECRET_TOKEN } from '../../../utils/prechecks.ts';
import * as bcrypt from 'jsr:@da/bcrypt';
import * as bcrypt from '@da/bcrypt';
import { verifyTotp } from '../../../utils/totp.ts';
const DEFAULT_SESSION_TIME: number = 28 * (24 * (60 * (60 * 1_000))); // 28 days
@ -79,7 +79,7 @@ export async function POST(req: Request, meta: Record<string, any>): Promise<Res
});
}
const verified = await bcrypt.compare(password_hash, password_entry.hash);
const verified = bcrypt.compareSync(password_hash, password_entry.hash);
if (!verified) {
return Response.json({