From 421192486b7cebfc8235119f96f44e21d3ceb38a Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Mon, 13 Mar 2023 18:30:02 +0100 Subject: [PATCH] fix(ui) - check for login on redirect --- frontend/app/Router.js | 2 -- frontend/app/components/Login/Login.js | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/app/Router.js b/frontend/app/Router.js index 662a7a7a7..81fcaefc3 100644 --- a/frontend/app/Router.js +++ b/frontend/app/Router.js @@ -120,8 +120,6 @@ class Router extends React.Component { super(props); if (props.isLoggedIn) { this.fetchInitialData(); - } else { - props.fetchTenants(); } } diff --git a/frontend/app/components/Login/Login.js b/frontend/app/components/Login/Login.js index b51970036..05702a2fe 100644 --- a/frontend/app/components/Login/Login.js +++ b/frontend/app/components/Login/Login.js @@ -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);