From 91201d4eaa031bbdb9aa3ea4d9964b3386123e98 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Wed, 8 May 2024 11:40:38 +0200 Subject: [PATCH] fix(ui): use the jwt from url before reading from storage --- frontend/app/Router.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/app/Router.js b/frontend/app/Router.js index 8394dbc0f..ee87ac782 100644 --- a/frontend/app/Router.js +++ b/frontend/app/Router.js @@ -127,6 +127,11 @@ const MULTIVIEW_INDEX_PATH = routes.multiviewIndex(); class Router extends React.Component { constructor(props) { super(props); + const urlJWT = new URLSearchParams(window.location.search).get('jwt'); + if (urlJWT) { + props.setJwt(urlJWT); + } + if (props.isLoggedIn) { this.fetchInitialData(); } @@ -136,10 +141,7 @@ class Router extends React.Component { isJwt: checkParam('jwt', JWT_PARAM) }; - const urlJWT = new URLSearchParams(window.location.search).get('jwt'); - if (urlJWT && !props.isLoggedIn) { - props.setJwt(urlJWT); - } + } fetchInitialData = async () => {