Closed njordhov closed 5 years ago
After authentication, cleaning the browser location by setting window.location results in untimely refreshing of the page:
window.location
window.location = window.location.origin
Instead, the window location can be cleaned using:
window.history.replaceState({}, document.title, "/")
The current implementation still requires a refresh unless there are more substantial refactoring of the signin flow. Here is a suggested replacement for the offending componentWillMount implementations in App.js that also resolves issue #25 :
componentWillMount
componentDidMount() { if (userSession.isSignInPending()) { userSession.handlePendingSignIn().then((userData) => { // window.location = window.location.origin; window.history.replaceState({}, document.title, "/") this.setState({ userData: userData}) }); } }
Could you make a PR with this changes? Looks like something we would merge.
After authentication, cleaning the browser location by setting
window.location
results in untimely refreshing of the page:Instead, the window location can be cleaned using:
The current implementation still requires a refresh unless there are more substantial refactoring of the signin flow. Here is a suggested replacement for the offending
componentWillMount
implementations in App.js that also resolves issue #25 :