#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) => { Self.signInValidate = async (user, userToken, token, ctx) => {
const [[key, value]] = Object.entries(Self.userUses(user)); const [[key, value]] = Object.entries(Self.userUses(user));
const where = Self.userUses(user); const isOwner = Self.rawSql(`SELECT ? = ? `, [userToken[key], value]);
const vnUser = await Self.findOne({
fields: ['id', 'username', 'email'],
where
});
const isOwner = userToken[key].toLowerCase() === vnUser[key].toLowerCase();
await Self.app.models.SignInLog.create({ await Self.app.models.SignInLog.create({
token: token.id, token: token.id,
userFk: userToken.id, userFk: userToken.id,