Skip to content

Commit e062928

Browse files
mattwr18joaopapereira
authored andcommitted
Update this.props.history.push to handle users logging in from the root path
1 parent b2e0e8c commit e062928

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/containers/LogIn.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class LogIn extends Component {
1717
const { cookies, loggedInUser, history, lastLocation, postLogInInfo } = this.props
1818
postLogInInfo({ email, password })
1919
.then(() => {
20-
history.push(lastLocation.path + lastLocation.search)
20+
lastLocation.path ? history.push(lastLocation.path + lastLocation.search) : history.push('/')
2121
cookies.set('_WebsiteOne_session', this.props.loggedInUser.headers.authorization, {
2222
path: '/'
2323
})

0 commit comments

Comments
 (0)