refs #5554 refactor: 'renewToken' utiliza logout y createAccessToken
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
6010bc1253
commit
f471d62d41
|
@ -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};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue