refs #6434 perf: use rawSql instead query
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
a3076e4fa1
commit
a7be577e92
|
@ -126,12 +126,7 @@ module.exports = function (Self) {
|
|||
});
|
||||
Self.signInValidate = async (user, userToken, token, ctx) => {
|
||||
const [[key, value]] = Object.entries(Self.userUses(user));
|
||||
const where = Self.userUses(user);
|
||||
const vnUser = await Self.findOne({
|
||||
fields: ['id', 'username', 'email'],
|
||||
where
|
||||
});
|
||||
const isOwner = userToken[key].toLowerCase() === vnUser[key].toLowerCase();
|
||||
const isOwner = Self.rawSql(`SELECT ? = ? `, [userToken[key], value]);
|
||||
await Self.app.models.SignInLog.create({
|
||||
token: token.id,
|
||||
userFk: userToken.id,
|
||||
|
|
Loading…
Reference in New Issue