Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

fix: allow unauthenticated access to public share links

jubnlc944a7d1019c
diff --git a/client/src/App.tsx b/client/src/App.tsx
index 0235276a2..46e51a124 100644
--- a/client/src/App.tsx
+++ b/client/src/App.tsx
@@ -79,7 +79,9 @@ export default function App() {
const { loadSettings } = useSettingsStore()
useEffect(() => {
- loadUser()
+ if (!location.pathname.startsWith('/shared/')) {
+ loadUser()
+ }
authApi.getAppConfig().then(async (config: { demo_mode?: boolean; has_maps_key?: boolean; version?: string; timezone?: string; require_mfa?: boolean; trip_reminders_enabled?: boolean; permissions?: Record<string, PermissionLevel> }) => {
if (config?.demo_mode) setDemoMode(true)
if (config?.has_maps_key !== undefined) setHasMapsKey(config.has_maps_key)
diff --git a/client/src/api/client.ts b/client/src/api/client.ts
index a901a5bc7..facf652de 100644
--- a/client/src/api/client.ts
+++ b/client/src/api/client.ts
@@ -26,7 +26,7 @@ apiClient.interceptors.response.use(
(response) => response,
(error) => {
if (error.response?.status === 401 && (error.response?.data as { code?: string } | undefined)?.code === 'AUTH_REQUIRED') {
- if (!window.location.pathname.includes('/login') && !window.location.pathname.includes('/register')) {
+ if (!window.location.pathname.includes('/login') && !window.location.pathname.includes('/register') && !window.location.pathname.startsWith('/shared/')) {
window.location.href = '/login'
}
}