refs #5554 refactor: 'renewToken' utiliza logout y createAccessToken
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Vicent Llopis 2023-05-25 10:09:38 +02:00
parent 6010bc1253
commit f471d62d41
1 changed files with 3 additions and 2 deletions

View File

@ -33,8 +33,9 @@ module.exports = Self => {
return response;
}
const accessToken = await models.AccessToken.create({userId: userId});
await models.AccessToken.destroyById(tokenId);
await Self.logout(tokenId);
const user = await Self.findById(userId);
const accessToken = await user.createAccessToken();
return {token: accessToken.id, created: accessToken.created};
};