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

Update callback.js #1424

Merged
merged 2 commits into from
Mar 5, 2021
Merged

Update callback.js #1424

merged 2 commits into from
Mar 5, 2021

Conversation

Baterka
Copy link
Contributor

@Baterka Baterka commented Mar 3, 2021

What:

Changed encodeURIComponent(error) to encodeURIComponent(error.message) in routes/callback.js to remove prefix (such as Error: and possible stack trace).

Why:

Seems like better way of doing it and also safer if server throws some errors with sensitive data.

My usecase as example: I was throwing custom error codes such as CaptchaSignin (invalid captcha) and my url always looked like: .../api/auth/error?error=Error:%20OAuthSignin

How:

Just changed

Checklist: error to error.message

  • Documentation
  • Tests
  • Ready to be merged

Changed `encodeURIComponent(error)` to `encodeURIComponent(error.message)` to remove prefix (such as `Error: ` and possible stack trace).
Seems like better way of doing it and also safer if server throws some error with sensitive data.
@vercel
Copy link

vercel bot commented Mar 3, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nextauthjs/next-auth/4LTpiu9Y4u1dToFni19w7cfszE48
✅ Preview: https://next-auth-git-fork-baterka-main-nextauthjs.vercel.app

@vercel vercel bot temporarily deployed to Preview March 3, 2021 18:36 Inactive
@github-actions github-actions bot added the core Refers to `@auth/core` label Mar 3, 2021
@vercel vercel bot temporarily deployed to Preview March 4, 2021 10:30 Inactive
@balazsorban44 balazsorban44 merged commit 960ca85 into nextauthjs:main Mar 5, 2021
@github-actions
Copy link

github-actions bot commented Mar 5, 2021

🎉 This PR is included in version 3.7.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version 4.0.0-next.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

mnphpexpert added a commit to mnphpexpert/next-auth that referenced this pull request Sep 2, 2024
Changed `encodeURIComponent(error)` to `encodeURIComponent(error.message)` to remove prefix (such as `Error: ` and possible stack trace).
Seems like better way of doing it and also safer if server throws some error with sensitive data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Refers to `@auth/core`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants