Skip to content

[stable35] fix(auth): delete auth tokens past their expiration date - #66774

Open
backportbot[bot] wants to merge 1 commit into
stable35from
backport/66625/stable35
Open

backportbot[bot] wants to merge 1 commit into
stable35from
backport/66625/stable35

Conversation

@backportbot

@backportbot backportbot Bot commented Nov 18, 2026

Copy link
Copy Markdown

Backport of PR #66625

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>
@backportbot
backportbot Bot requested review from a team as code owners November 18, 2026 20:31
@backportbot
backportbot Bot requested review from artonge and cristianscheid and removed request for a team November 18, 2026 20:31
@backportbot backportbot Bot added the 3. to review Waiting for reviews label Nov 18, 2026
@backportbot
backportbot Bot requested review from CarlSchwan and leftybournes and removed request for a team November 18, 2026 20:31
@backportbot backportbot Bot added this to the Nextcloud 35.0.4 milestone Nov 18, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant