@micha.bigler/ui-core-micha 2.2.9 → 2.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/apiClient.js +4 -1
- package/package.json +1 -1
- package/src/auth/apiClient.jsx +5 -1
package/dist/auth/apiClient.js
CHANGED
|
@@ -19,12 +19,15 @@ const PUBLIC_PATHS = [
|
|
|
19
19
|
"/reset", // Reset Link (/reset/:uid/:token)
|
|
20
20
|
"/welcome" // Optional: Falls Welcome auch öffentlich ist
|
|
21
21
|
];
|
|
22
|
+
function isPublicSitePath(pathname) {
|
|
23
|
+
return pathname === "/sites" || pathname.startsWith("/sites/");
|
|
24
|
+
}
|
|
22
25
|
function redirectToLoginOnce() {
|
|
23
26
|
if (!isBrowser())
|
|
24
27
|
return;
|
|
25
28
|
const currentPath = window.location.pathname;
|
|
26
29
|
// 1. Check: Sind wir auf einer öffentlichen Seite?
|
|
27
|
-
const isPublicPage = PUBLIC_PATHS.some(path => currentPath.startsWith(path));
|
|
30
|
+
const isPublicPage = isPublicSitePath(currentPath) || PUBLIC_PATHS.some(path => currentPath.startsWith(path));
|
|
28
31
|
// Wenn ja: NICHT weiterleiten. Der 401 Fehler wird an die Komponente durchgereicht.
|
|
29
32
|
if (isPublicPage)
|
|
30
33
|
return;
|
package/package.json
CHANGED
package/src/auth/apiClient.jsx
CHANGED
|
@@ -24,13 +24,17 @@ const PUBLIC_PATHS = [
|
|
|
24
24
|
"/welcome" // Optional: Falls Welcome auch öffentlich ist
|
|
25
25
|
];
|
|
26
26
|
|
|
27
|
+
function isPublicSitePath(pathname) {
|
|
28
|
+
return pathname === "/sites" || pathname.startsWith("/sites/");
|
|
29
|
+
}
|
|
30
|
+
|
|
27
31
|
function redirectToLoginOnce() {
|
|
28
32
|
if (!isBrowser()) return;
|
|
29
33
|
|
|
30
34
|
const currentPath = window.location.pathname;
|
|
31
35
|
|
|
32
36
|
// 1. Check: Sind wir auf einer öffentlichen Seite?
|
|
33
|
-
const isPublicPage = PUBLIC_PATHS.some(path => currentPath.startsWith(path));
|
|
37
|
+
const isPublicPage = isPublicSitePath(currentPath) || PUBLIC_PATHS.some(path => currentPath.startsWith(path));
|
|
34
38
|
|
|
35
39
|
// Wenn ja: NICHT weiterleiten. Der 401 Fehler wird an die Komponente durchgereicht.
|
|
36
40
|
if (isPublicPage) return;
|