sodistore home as default loggin page

This commit is contained in:
Yinyin Liu 2026-03-26 10:31:32 +01:00
parent cc1ec216ee
commit 812962ace0
1 changed files with 20 additions and 3 deletions

View File

@ -34,6 +34,11 @@ function App() {
const searchParams = new URLSearchParams(location.search);
const username = searchParams.get('username');
const {
accessToSalimax,
accessToSodiohome,
accessToSodistore,
accessToSodistoreGrid,
accessToSodistorePro,
setAccessToSalimax,
setAccessToSalidomo,
setAccessToSodiohome,
@ -42,6 +47,18 @@ function App() {
setAccessToSodistorePro
} = useContext(ProductIdContext);
const defaultRoute = accessToSodiohome
? routes.sodiohome_installations
: accessToSodistorePro
? routes.sodistorepro_installations
: accessToSodistoreGrid
? routes.sodistoregrid_installations
: accessToSodistore
? routes.sodistore_installations
: accessToSalimax
? routes.installations
: routes.salidomo_installations;
const detectBrowserLanguage = (): string => {
const browserLang = navigator.language?.toLowerCase() || '';
if (browserLang.startsWith('de')) return 'de';
@ -186,11 +203,11 @@ function App() {
<Routes>
<Route
path={''}
element={<Navigate to={routes.installations}></Navigate>}
element={<Navigate to={defaultRoute}></Navigate>}
></Route>
<Route
path={'login'}
element={<Navigate to={routes.installations}></Navigate>}
element={<Navigate to={defaultRoute}></Navigate>}
></Route>
<Route
path="/"
@ -259,7 +276,7 @@ function App() {
<Route path={routes.users + '*'} element={<Users />} />
<Route
path={'*'}
element={<Navigate to={routes.installations}></Navigate>}
element={<Navigate to={defaultRoute}></Navigate>}
></Route>
<Route path="ResetPassword" element={<ResetPassword />}></Route>
</Route>