fix(ui): use the jwt from url before reading from storage

This commit is contained in:
Shekar Siri 2024-05-08 11:40:38 +02:00 committed by rjshrjndrn
parent a1abd6cae8
commit 91201d4eaa

View file

@ -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 () => {