Bugfix: Redirecting to /login instead of / (#1419)

* after correct creds are provided should not redirected to '/login' instead should redirect to '/'

* resolved conflicts
This commit is contained in:
Arpit 2021-11-17 19:25:59 +05:30 committed by GitHub
parent 4d01aa31a1
commit 07572e6ce5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -52,7 +52,8 @@ class LoginPage extends React.Component {
authSuccessHandler = () => {
const params = queryString.parse(this.props.location.search);
const { from } = params.redirectTo ? { from: { pathname: params.redirectTo } } : { from: { pathname: '/' } };
this.props.history.push(from);
const redirectPath = from.pathname === '/login' ? '/' : from;
this.props.history.push(redirectPath);
this.setState({ isLoading: false });
};