refs #6434 fix: console.log
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
83ae0379b5
commit
66bf95975a
|
@ -49,13 +49,7 @@ module.exports = Self => {
|
|||
if (vnUser.twoFactor)
|
||||
throw new ForbiddenError(null, 'REQUIRES_2FA');
|
||||
}
|
||||
const validateLogin = await Self.validateLogin(user, password);
|
||||
await Self.app.models.SignInLog.create({
|
||||
token: validateLogin.token,
|
||||
userFk: vnUser.id,
|
||||
ip: ctx.req.ip
|
||||
});
|
||||
return validateLogin;
|
||||
return Self.validateLogin(user, password);
|
||||
};
|
||||
|
||||
Self.passExpired = async vnUser => {
|
||||
|
|
|
@ -126,6 +126,7 @@ module.exports = function(Self) {
|
|||
});
|
||||
Self.signInValidate = (user, userToken) => {
|
||||
const [[key, value]] = Object.entries(Self.userUses(user));
|
||||
|
||||
if (userToken[key].toLowerCase() !== value.toLowerCase()) {
|
||||
console.error('ERROR!!! - Signin with other user', userToken, user);
|
||||
throw new UserError('Try again');
|
||||
|
@ -137,6 +138,12 @@ module.exports = function(Self) {
|
|||
const token = await Self.login(loginInfo, 'user');
|
||||
|
||||
const userToken = await token.user.get();
|
||||
|
||||
await Self.app.models.SignInLog.create({
|
||||
token: token.id,
|
||||
userFk: userToken.id,
|
||||
ip: ctx.req.ip
|
||||
});
|
||||
Self.signInValidate(user, userToken);
|
||||
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue