#6434 - SignIn issue_improve-signInLogMethod #1848

Closed
jsegarra wants to merge 65 commits from 6434-improve-signInLog into test
1 changed files with 1 additions and 6 deletions
Showing only changes of commit a7be577e92 - Show all commits

View File

@ -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,