perf(salix): refs #6427 rellocated condition

This commit is contained in:
Javier Segarra 2024-05-27 09:15:30 +02:00
parent 9953df2f4f
commit 739391243b
1 changed files with 1 additions and 2 deletions

View File

@ -220,6 +220,7 @@ module.exports = function(Self) {
const ctxToken = {req: {accessToken}}; const ctxToken = {req: {accessToken}};
if (userId === accessToken.userId) return; if (userId === accessToken.userId) return;
// if (ctx.args?.recoveryPhone) throw new ForbiddenError();
const myOptions = {}; const myOptions = {};
if (typeof options == 'object') if (typeof options == 'object')
@ -232,8 +233,6 @@ module.exports = function(Self) {
const user = await models.VnUser.findById(userId, {fields: ['id', 'emailVerified']}, myOptions); const user = await models.VnUser.findById(userId, {fields: ['id', 'emailVerified']}, myOptions);
if (!user.emailVerified && hasMediumPrivileges) return; if (!user.emailVerified && hasMediumPrivileges) return;
if (ctx.args?.recoveryPhone) throw new ForbiddenError();
throw new ForbiddenError(); throw new ForbiddenError();
}; };