diff --git a/src/components/layout/header/header.tsx b/src/components/layout/header/header.tsx index 5fe68fa4..bf22d8e1 100644 --- a/src/components/layout/header/header.tsx +++ b/src/components/layout/header/header.tsx @@ -104,16 +104,20 @@ const AppHeader = observer(() => { const currency = getQueryParams.get('account') ?? ''; const query_param_currency = sessionStorage.getItem('query_param_currency') || currency || 'USD'; - await requestOidcAuthentication({ - redirectCallbackUri: `${window.location.origin}/callback`, - ...(query_param_currency - ? { - state: { - account: query_param_currency, - }, - } - : {}), - }); + try { + await requestOidcAuthentication({ + redirectCallbackUri: `${window.location.origin}/callback`, + ...(query_param_currency + ? { + state: { + account: query_param_currency, + }, + } + : {}), + }); + } catch (err) { + console.error(err); + } } }} > diff --git a/src/components/layout/index.tsx b/src/components/layout/index.tsx index b78a75e9..33017ed4 100644 --- a/src/components/layout/index.tsx +++ b/src/components/layout/index.tsx @@ -129,17 +129,20 @@ const Layout = () => { if (query_param_currency) { sessionStorage.setItem('query_param_currency', query_param_currency); } - - requestOidcAuthentication({ - redirectCallbackUri: `${window.location.origin}/callback`, - ...(query_param_currency - ? { - state: { - account: query_param_currency, - }, - } - : {}), - }); + try { + requestOidcAuthentication({ + redirectCallbackUri: `${window.location.origin}/callback`, + ...(query_param_currency + ? { + state: { + account: query_param_currency, + }, + } + : {}), + }); + } catch (err) { + console.error(err); + } } }, [ isLoggedInCookie,