Skip to content

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

Merged
artonge merged 1 commit into
stable35from
backport/66625/stable35
Nov 20, 2026
Merged

artonge merged 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
@artonge
artonge enabled auto-merge November 20, 2026 10:59
@artonge
artonge merged commit c55feff into stable35 Nov 20, 2026
155 of 161 checks passed
@artonge
artonge deleted the backport/66625/stable35 branch November 20, 2026 11:33
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants