Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Expose RouterMethod to push LoginRoute + post-login redirect path #598

Open
SanzSeraph opened this issue Feb 12, 2017 · 0 comments
Open

Comments

@SanzSeraph
Copy link

SanzSeraph commented Feb 12, 2017

This was meant for the react-stormpath repository.

This is a proposed enhancement, not a bug.

In a situation where the server replies with a 401 (for example, if you are using express-stormpath to validate AccessTokens,) it would be very useful to have a built-in way to push the login path with the "?next" parameter set to a prescribed path.

this.props.router.pushLoginRoute('/mypreviouspath');

This can currently be achieved with this.props.router.push('/myloginpath?next=' + encodeURIComponent('/mypreviouspath')); which is a bit messy.

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

No branches or pull requests

1 participant