Merge pull request #1035 from openreplay/fix-login-check

fix(ui) - check for login on redirect
This commit is contained in:
Shekar Siri 2023-03-14 10:20:40 +01:00 committed by GitHub
commit 455e53dc14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -120,8 +120,6 @@ class Router extends React.Component {
super(props);
if (props.isLoggedIn) {
this.fetchInitialData();
} else {
props.fetchTenants();
}
}

View file

@ -11,6 +11,7 @@ import cn from 'classnames';
import { setJwt } from 'Duck/user';
import LoginBg from '../../svg/login-illustration.svg';
import { ENTERPRISE_REQUEIRED } from 'App/constants';
import { fetchTenants } from 'Duck/user';
const FORGOT_PASSWORD = forgotPassword();
const SIGNUP_ROUTE = signup();
@ -24,7 +25,7 @@ export default
authDetails: state.getIn(['user', 'authDetails']),
params: new URLSearchParams(props.location.search),
}),
{ login, setJwt }
{ login, setJwt, fetchTenants }
)
@withPageTitle('Login - OpenReplay')
@withRouter
@ -37,6 +38,7 @@ class Login extends React.Component {
componentDidMount() {
const { params } = this.props;
this.props.fetchTenants();
const jwt = params.get('jwt');
if (jwt) {
this.props.setJwt(jwt);