Changed sign-up flow to require e-mail verification up front, preventing account existence leakage.
This commit is contained in:
+5
-1
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user