mirror of
https://github.com/nextcloud/server.git
synced 2026-11-23 14:04:24 +01:00
Tokens with an explicit expiration date are rejected once it has passed, but invalidateOldTokens() only looks at last_activity, so a permanent token with an expiry stays in oc_authtoken and in Devices & sessions for a year. Apps that create short-lived tokens (e.g. Passwords web UI sessions) pile up hundreds of dead entries. Delete them in the hourly clean-up once they expired more than token_auth_expired_token_retention seconds ago (default 7 days). The grace period keeps the existing behaviour that a client still sending an expired token is rejected quietly instead of counting as a failed login. Remote wipe tokens keep their own retention. Fixes #61833 Signed-off-by: SKroman108 <138336203+SKroman108@users.noreply.github.com>