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

Fix Discord OAuth issues #23

Merged
merged 2 commits into from
Mar 3, 2025
Merged

Fix Discord OAuth issues #23

merged 2 commits into from
Mar 3, 2025

Conversation

AlexthePear
Copy link
Collaborator

Discord OAuth Issues

Issues include a 401 error when fetching GuildMember, improper access control for unauthenticated users, and ensuring users are redirected back to their original destination after OAuth authentication.

Changes

Fix 401 Error when Fetching GuildMember

  • Resolved an issue where a request to fetch GuildMember was returning a 401 Unauthorized error.
  • Updated authentication headers to ensure the bot has proper authorization when making API requests.

Improve Authentication & Authorization

  • Prevented users from accessing pages without proper authentication and authorization.
  • Updated +Layout.svelte in the forms route to properly handle redirects instead of just creating them without execution.
  • Fixing the previous issue with fetching GuildMember now enables a specified role to be required on a Server to be able to login.

Fix Incorrect login Redirect

  • Resolved an issue where users were always redirected to the homepage after logging in instead of the original URL they attempted to access.
  • Updated makeOAuth2URL to include state="", ensuring the original URL is saved throughout the OAuth process.

* Fix 401 error when fetching GuildMember
* Ensure user cannot access pages without being logged in
* Redirect user back to original URL after OAuth authentication
Copy link

netlify bot commented Feb 26, 2025

Deploy Preview for acmcsufoss-form ready!

Name Link
🔨 Latest commit a43af22
🔍 Latest deploy log https://app.netlify.com/sites/acmcsufoss-form/deploys/67bef8543bf879000870b624
😎 Deploy Preview https://deploy-preview-23--acmcsufoss-form.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@AlexthePear AlexthePear merged commit b65b5d7 into main Mar 3, 2025
6 checks passed
@AlexthePear AlexthePear deleted the OAuth_fix branch March 3, 2025 08:26
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.

1 participant