CallbackURL being truncated on sign up
When I sign up via email + password, the url looks correct in the email i.e.
http://localhost:3000/auth/sign-in?provider=credentials&newUser=true
But when I click the link, it takes me to:
http://localhost:3000/auth/sign-in?provider=credentials
- cutting off the extra queries
The middleware logs show for ctx.query:
"query":{"token":"[Redacted]","callbackURL":"http://localhost:3000/auth/sign-in?provider=credentials","newUser":"true"}
2 Replies
Can you elaborate on how this relates to Better-Auth?
Somewhere internally it's cutting off the query so
http://localhost:3000/auth/sign-in?provider=credentials&newUser=true
becomes
http://localhost:3000/auth/sign-in?provider=credentials
when the actual redirection occurs, and newUser
is added to the ctx.query separately
I'm assuming that it's considering after the &
as a part of the verification url and not the callbackURL. Basically the query belongs to the callbackURL value within the verification url and not the verification url itself. Does that make sense?
Update:
What is: "query":{"token":"[Redacted]","callbackURL":"http://localhost:3000/auth/sign-in?provider=credentials","newUser":"true"}
What should be: "query":{"token":"[Redacted]","callbackURL":"http://localhost:3000/auth/sign-in?provider=credentials&newUser=true"}
Also, encoding it gives "invalid callbackURL" error