Skip to content

Commit

Permalink
chore: remove debug-env api (#532)
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa authored Dec 26, 2023
1 parent e0a4aea commit 3845450
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 48 deletions.
32 changes: 0 additions & 32 deletions app/routes/dev/debug-env.tsx

This file was deleted.

7 changes: 1 addition & 6 deletions app/utils/auth.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { tinyassert } from "@hiogawa/utils";
import { E, T, db, selectOne } from "../db/drizzle-client.server";
import type { UserTable } from "../db/models";
import {
toPasswordHash,
verifyPassword,
verifyPasswordNoop,
} from "./password-utils";
import { toPasswordHash, verifyPassword } from "./password-utils";

const DEFAULT_TIMEZONE = "+00:00";

Expand Down Expand Up @@ -55,7 +51,6 @@ export async function verifySignin(data: {
E.eq(T.users.username, data.username)
);
if (!user) {
await verifyPasswordNoop();
return false;
}
return await verifyPassword(data.password, user.passwordHash);
Expand Down
10 changes: 0 additions & 10 deletions app/utils/password-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,3 @@ export async function verifyPassword(

return worker.argon2.verify_password(password, passwordHash);
}

// fake verification for timing safety?
export async function verifyPasswordNoop() {
await verifyPassword(
"noop-for-timing-safety",
// dummy hash generated by
// node -r esbuild-register -e 'lib = require("./app/utils/password-utils.ts"); lib.initializeArgon2().then(() => lib.toPasswordHash("").then(console.log))'
"$argon2id$v=19$m=19456,t=2,p=1$9i2rshv5CH6kecJSbN0pLw$sCqIUzQzO2gC+TewudcBIcGX9kPtxIaXCaIbEiX7ecI"
);
}

0 comments on commit 3845450

Please sign in to comment.