Changed sign-up flow to require e-mail verification up front, preventing account existence leakage.
This commit is contained in:
+8
-2
@@ -56,6 +56,14 @@ function whereUser(builder, userId, options = {}) {
|
||||
}
|
||||
|
||||
export async function fetchUser(userId, options = {}, reqUser) {
|
||||
if (!userId) {
|
||||
if (options.raw) {
|
||||
return { user: null };
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
const user = await knex('users')
|
||||
.select(knex.raw('users.*, users_roles.abilities as role_abilities'))
|
||||
.modify((builder) => whereUser(builder, userId, options))
|
||||
@@ -119,8 +127,6 @@ export async function removeTemplate(templateId, reqUser) {
|
||||
}
|
||||
|
||||
export async function createBan(ban, reqUser) {
|
||||
console.log(ban);
|
||||
|
||||
if (reqUser.role !== 'admin') {
|
||||
throw new HttpError('You do not have sufficient privileges to set a ban', 403);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user