Improved assigning of "last-activity" and "login_date"

This commit is contained in:
Michael 2024-03-05 14:06:26 +00:00
parent dc96a72173
commit 72e045e744
4 changed files with 25 additions and 42 deletions

View file

@ -183,10 +183,7 @@ class BasicAuth
throw new UnauthorizedException("This API requires login");
}
// Don't refresh the login date more often than twice a day to spare database writes
$login_refresh = strcmp(DateTimeFormat::utc('now - 12 hours'), $record['login_date']) > 0;
DI::auth()->setForUser($a, $record, false, false, $login_refresh);
DI::auth()->setForUser($a, $record, false, false, false);
Hook::callAll('logged_in', $record);