Skip to content

Fix Discord token auto-auth fallback - #10

Draft
ZARAEM wants to merge 3 commits into
pratherbytecraft:mainfrom
ZARAEM:codex/fix-token-login
Draft

Fix Discord token auto-auth fallback#10
ZARAEM wants to merge 3 commits into
pratherbytecraft:mainfrom
ZARAEM:codex/fix-token-login

Conversation

@ZARAEM

@ZARAEM ZARAEM commented Jul 13, 2026

Copy link
Copy Markdown

Summary

  • Move Discord token extraction into a focused helper used by the content script.
  • Retry auth token lookup after dispatching beforeunload, which matches Discord's token flush behavior used by the bundled Classic extension.
  • Add a same-origin iframe storage fallback for cases where the page's direct localStorage surface is unavailable.
  • Add regression coverage for direct storage tokens, beforeunload-flushed tokens, and iframe storage fallback.

Root cause

Extension auto-auth only checked direct page localStorage, so Discord changes that keep or expose the token differently could leave Discrub unable to retrieve a token even while the user is logged into discord.com.

Fixes #9.

Validation

  • npm test -- src/extension/content.test.ts src/extension/tokenExtraction.test.ts
  • npm test -- src/extension/background.test.ts src/extension/messaging.test.ts src/extension/integration.test.ts
  • npm run build:extension:chrome
  • npm run build:extension:firefox
  • npm run build

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.

Can no longer log in with Token

1 participant