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

Add callbackUrl field to credentials signin form #8883

Closed
wants to merge 1 commit into from

Conversation

jjonescz
Copy link
Contributor

@jjonescz jjonescz commented Oct 17, 2023

☕️ Reasoning

The bug:

  1. Visit the signin page with a callback URL (e.g., /auth/signin?callbackUrl=/test).
  2. In parallel visit another URL which also redirects to sign in (e.g. the browser automatically requests /favicon.ico and is redirected to /auth/signin?callbackUrl=/favicon.ico which saves /favicon.ico into callbackUrl cookie).
  3. Now fill in credentials and sign into the first page - it redirects to /favicon.ico instead of /test. That's because the callbackUrl from the query string is lost for the credentials provider (this PR should fix that) and the cookie is used instead.

🧢 Checklist

  • Documentation
  • Tests
  • Ready to be merged

🎫 Affected issues

📌 Resources

@vercel
Copy link

vercel bot commented Oct 17, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
auth-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2023 2:47pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
next-auth-docs ⬜️ Ignored (Inspect) Visit Preview Oct 17, 2023 2:47pm

@vercel
Copy link

vercel bot commented Oct 17, 2023

@jjonescz is attempting to deploy a commit to the authjs Team on Vercel.

A member of the Team first needs to authorize it.

@ThangHuuVu
Copy link
Member

@jjonescz hey sorry for the late reply, I'm not able to reproduce this using our deployed example: https://next-auth-example.vercel.app/auth/signin?callbackUrl=/favicon.ico

Could you open an issue first with a minimal reproducible example? I'm going to close this in the meantime to reduce maintaining overhead

@ThangHuuVu ThangHuuVu closed this Jun 8, 2024
@jjonescz jjonescz deleted the credentials-callbackUrl branch June 10, 2024 13:08
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