Changed sign-up flow to require e-mail verification up front, preventing account existence leakage.

This commit is contained in:
2026-07-23 22:12:33 +02:00
parent 18c30b6f98
commit 6b3866a99f
12 changed files with 387 additions and 79 deletions
+5 -1
View File
@@ -126,6 +126,10 @@ export async function fetchStashByUsernameAndSlug(usernameOrId, stashSlug, sessi
}
export async function fetchUserStashes(usernameOrId, reqUser) {
if (!usernameOrId) {
throw new HttpError(`No username or user ID provided`, 400);
}
const userId = typeof usernameOrId === 'number'
? usernameOrId
: await knex('users')
@@ -134,7 +138,7 @@ export async function fetchUserStashes(usernameOrId, reqUser) {
.then((user) => user?.id);
if (!userId) {
throw new HttpError(`Could not find user '${usernameOrId}'`);
throw new HttpError(`Could not find user '${usernameOrId}'`, 404);
}
const stashes = await knex('stashes')