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,12 +1,12 @@
import { PASSWORD_ENTRIES, PASSWORD_ENTRY } from '../../../models/password_entry.ts';
import { USER, USERS } from '../../../models/user.ts';
import lurid from 'jsr:@andyburke/lurid';
import { encodeBase64 } from 'jsr:@std/encoding';
import lurid from '@andyburke/lurid';
import { encodeBase64 } from '@std/encoding';
import parse_body from '../../../utils/bodyparser.ts';
import { create_new_session, SESSION_RESULT } from '../auth/index.ts';
import { get_session, get_user, PRECHECK_TABLE, require_user } from '../../../utils/prechecks.ts';
import * as CANNED_RESPONSES from '../../../utils/canned_responses.ts';
import * as bcrypt from 'jsr:@da/bcrypt';
import * as bcrypt from '@da/bcrypt';
// TODO: figure out a better solution for doling out permissions
const DEFAULT_USER_PERMISSIONS: string[] = [
@ -107,7 +107,7 @@ export async function POST(req: Request, meta: Record<string, any>): Promise<Res
await USERS.create(user);
// automatically salted
const hashed_password_value = await bcrypt.hash(password_hash);
const hashed_password_value = bcrypt.hashSync(password_hash);
const password_entry: PASSWORD_ENTRY = {
user_id: user.id,