Skip to content

fix: extend CONNECT_TOKEN_EXPIRY_DAYS to 365#5040

Merged
wescopeland merged 2 commits into
RetroAchievements:masterfrom
wescopeland:extend-connect-token-expiry-days
Jul 11, 2026
Merged

fix: extend CONNECT_TOKEN_EXPIRY_DAYS to 365#5040
wescopeland merged 2 commits into
RetroAchievements:masterfrom
wescopeland:extend-connect-token-expiry-days

Conversation

@wescopeland

Copy link
Copy Markdown
Member

https://discord.com/channels/310192285306454017/1522631190304129215
https://retroachievements.org/forums/topic/19254

The 14 day expiry isn't actually buying us much at the moment. I'd also argue this short of a window is actively degrading security. The documented community workaround in the linked forum thread is to store plaintext passwords in retroarch.cfg and cron jobs, which is strictly worse than a long-lived token.

This PR changes the value from 14 to 365. The token still needs some expiry. I also favor 365 over a middle-ground value like 90, as the documented edge here is affected users play "a couple times a year." A 90-day window wouldn't buy us anything in that case either and still points the user to the undesirable workaround / failure mode in the forum thread.

@wescopeland
wescopeland requested a review from a team July 3, 2026 16:04
@greptile-apps

greptile-apps Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe to merge — single constant change with no logic alterations.

One constant is changed, the comment and test are updated in sync. No logic, auth flow, or schema is touched.

No files require special attention.

Reviews (2): Last reviewed commit: "Merge branch 'master' into extend-connec..." | Re-trigger Greptile

@denilsonsa

Copy link
Copy Markdown

I fully support this change, as it solves the main pain point for users who play once every few weeks.

If concerns are raised, I'd suggest having a long-lived token for achievements, and potentially a short-lived one for the actual website. Because:

  • A token that only has permission to submit leaderboard scores and achievements has a very low risk.
  • A token that can post content on the website has risk for spam.
  • A token that can change user settings (e.g. profile info) also has risk.
  • Website users often have password managers integrated into their browsers. People playing on emulators are often playing on devices without a keyboard (e.g. handhelds or dedicated emulation machines).

(Note: This comment was made without knowing anything on how the actual tokens work in RA. It is my suggestion based on my own experience as a developer myself.)

@Jamiras Jamiras left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If approved, this will close #1813. The request to copy/paste is an emulator feature.

Comment thread app/Platform/Concerns/HasConnectToken.php
@wescopeland
wescopeland enabled auto-merge (squash) July 11, 2026 22:34
@wescopeland
wescopeland merged commit 493bcef into RetroAchievements:master Jul 11, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants