When a user is required to re-authenticate, I would like them to be redirected back to the same URL they came from afterwards. In my case, auth.history does not match window.location because I am updating the URL as the users navigate the site (using browserHistory). So auth.login() doesn't do what I want.
Now auth.login's first parameter is fromUri, but it is limited: it must be a string corresponding to a pathname, as Auth.js uses it like so:
works, but it is not enough – my users need to be redirected to a URL including query parameters (from location.search, not just location.pathname), and they are stripped.
I'm submitting this issue for the package(s):
I'm submitting a:
Current behavior
When a user is required to re-authenticate, I would like them to be redirected back to the same URL they came from afterwards. In my case,
auth.history
does not matchwindow.location
because I am updating the URL as the users navigate the site (usingbrowserHistory
). Soauth.login()
doesn't do what I want.Now
auth.login
's first parameter isfromUri
, but it is limited: it must be a string corresponding to apathname
, asAuth.js
uses it like so:So
works, but it is not enough – my users need to be redirected to a URL including query parameters (from
location.search
, not justlocation.pathname
), and they are stripped.I tried
but this simply hangs when it returns.
Expected behavior
Ideally I could just do
To achieve this,
Auth.js
'slogin
could check iffromUri
is an object, and if so just use it.Minimal reproduction of the problem with instructions
Extra information about the use case/user story you are trying to implement
Environment
node -v
):