mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 15:13:21 +00:00
update lastUsed when token is accessed
This commit is contained in:
parent
f95bb29d76
commit
215735b0cd
@ -38,6 +38,11 @@ const authenticate = async ctx => {
|
||||
return { authenticated: false };
|
||||
}
|
||||
|
||||
// update lastUsed
|
||||
await apiTokenService.update(apiToken.id, {
|
||||
lastUsed: new Date(),
|
||||
});
|
||||
|
||||
if (apiToken.type === constants.API_TOKEN_TYPE.CUSTOM) {
|
||||
const ability = await strapi.contentAPI.permissions.engine.generateAbility(
|
||||
apiToken.permissions.map(action => ({ action }))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user