Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redirect to auth callback if session / realm aren't found in memory #3

Closed

Conversation

shellhazard
Copy link

@shellhazard shellhazard commented Jun 14, 2023

Problem
If the server restarts after a user authenticates, when they revisit a protected page they'll be greeted with an unfriendly 401 unless their cookie has already expired. The workaround for this is to have a user clear their cookies, but this is less than ideal.

Solution
When a user provides a token with an invalid session or realm, redirect them to the Discord authentication page instead of completely blocking them out.

Additional changes
While I was poking around, I figured I'd add configuration for the name of the cookie that gets set in the browser by this plugin as allowing only the default exposes an implementation detail, which is better avoided where possible.

EDIT: Still not working as intended, following up with maintainer

@VeryStrongFingers
Copy link
Contributor

I ended up resolving this via 1b3219f

the issue turned out to be JWT changing signing key on every server start, the cookie was not the issue.
Discord application ID hashed is now the signing key to avoid this issue

still appreciate the PR and issue report though 😄

@shellhazard shellhazard deleted the fix/redirect-on-session-failure branch June 30, 2024 03:48
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.

2 participants