mirror of
https://github.com/strapi/strapi.git
synced 2025-12-26 14:44:31 +00:00
lastUsed update resolution to 1 hour
This commit is contained in:
parent
d535798aaa
commit
d3323219c3
@ -54,9 +54,9 @@ const authenticate = async (ctx) => {
|
||||
}
|
||||
}
|
||||
|
||||
// update lastUsedAt if the token has not been used for 24 hours
|
||||
// update lastUsedAt if the token has not been used in the last hour
|
||||
const hoursSinceLastUsed = differenceInHours(currentDate, parseISO(apiToken.lastUsedAt));
|
||||
if (hoursSinceLastUsed >= 24) {
|
||||
if (hoursSinceLastUsed >= 1) {
|
||||
await strapi.query('admin::api-token').update({
|
||||
where: { id: apiToken.id },
|
||||
data: { lastUsedAt: currentDate },
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user