I have an SSR page that is protected by withPageAuthRequired. The url for this page is in the format of http://localhost:3000/events?city=some-city&start=xxxx-xx-xx&end=xxxx-xx-xx.
When I'm logged in I have no problem accessing this page. When I'm not logged in I am redirected to the login page as expected. The problem is after logging in, I am redirected to http://localhost:3000/events?city=some-city. The rest of the url is not included in the redirect.
I should be redirected to the correct url which includes all the url/query string params.
I checked the network tab on Chrome and this is the url requested when I'm being redirected to the login page: http://localhost:3000/api/auth/login?returnTo=/events?city=some-city&start=xxxx-xx-xx&end=xxxx-xx-xx
I expect the returnTo url param to equal /events?city=some-city&start=xxxx-xx-xx&end=xxxx-xx-xx but that is not the case. There are actually 3 url params here:
returnTo: /events?city=some-citystart: xxxx-xx-xxend: xxxx-xx-xxThe returnTo value will only include the url up to the first url/query string param.
Thanks for reporting this @kpatel27
Looks like we need to encodeURIComponent somewhere - will investigate
@kpatel27 - have raised some work internally to fix this
Most helpful comment
@kpatel27 - have raised some work internally to fix this