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

Redirect does not include hash/fragment portion of URL #121

Closed
tlrobinson opened this issue Feb 24, 2017 · 3 comments
Closed

Redirect does not include hash/fragment portion of URL #121

tlrobinson opened this issue Feb 24, 2017 · 3 comments

Comments

@tlrobinson
Copy link

tlrobinson commented Feb 24, 2017

If the current URL contains a hash/fragment, i.e. /foo#bar, it is not included in the redirect query param (assuming allowRedirectBack is enabled).

Expected: /login?redirect=%2Ffoo%23bar
Actual: /login?redirect=%2Ffoo

Here's a workaround (assuming routerActions.replace is your existing redirectAction)

UserAuthWrapper({
    // ...
    redirectAction: (location) =>
        routerActions.replace({
            ...location,
            query: {
                ...location.query,
                redirect: location.query.redirect + (window.location.hash || "")
            }
        })
})
@mjrussell
Copy link
Owner

Good point, we are definitely not encoding that either. Should be similar to #111. Just to be clear, the expected should be /login?redirect=%2Ffoo%23bar right? (Not %2F which is /)

@tlrobinson
Copy link
Author

Oops, yeah %23, fixed.

@mjrussell
Copy link
Owner

mjrussell commented Mar 26, 2017

@tlrobinson just fixed this on master, going to see if there are any other issues to resolve and will get a new version out that supports this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants