refs #6059 validateLogin sync user
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2023-07-25 15:00:08 +02:00
parent b400e1983a
commit bf92c5d482
1 changed files with 8 additions and 0 deletions

View File

@ -115,6 +115,14 @@ module.exports = function(Self) {
Self.validateLogin = async function(user, password) {
let loginInfo = Object.assign({password}, Self.userUses(user));
token = await Self.login(loginInfo, 'user');
const userToken = await token.user.get();
try {
await Self.app.models.Account.sync(userToken.name, password);
} catch (err) {
console.warn(err);
}
return {token: token.id, ttl: token.ttl};
};