Skip to content
This repository was archived by the owner on Jan 4, 2018. It is now read-only.

Commit a84e712

Browse files
committed
Only redirect to nextPath if it exists
1 parent 996431b commit a84e712

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/components/pages/Login.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ export default class Login extends React.Component {
2828
const { history, store } = this.context
2929
const { location } = this.props
3030

31-
const nextPath = location.state.nextPathname || '/account'
31+
let nextPath = '/account'
32+
if (location.state && location.state.nextPath)
33+
nextPath = location.state.nextPath
34+
3235
store.dispatch(actions.login(this.state, () => {
3336
// redirect to a secure page
3437
history.pushState({}, nextPath)

0 commit comments

Comments
 (0)