diff --git a/frontend/src/App.vue b/frontend/src/App.vue index c698b6f..4da6214 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -5,6 +5,7 @@ + @@ -16,10 +17,15 @@ import LoginView from '@/components/LoginView.vue' import ProfileView from '@/components/ProfileView.vue' import DeviceLinkView from '@/components/DeviceLinkView.vue' import ResetView from '@/components/ResetView.vue' +import PermissionDeniedView from '@/components/PermissionDeniedView.vue' const store = useAuthStore() onMounted(async () => { + // Detect restricted mode: any path not starting with /auth/ + if (!location.pathname.startsWith('/auth/')) { + store.setRestrictedMode(true) + } // Was an error message passed in the URL hash? const message = location.hash.substring(1) if (message) { diff --git a/frontend/src/components/LoginView.vue b/frontend/src/components/LoginView.vue index 714ea68..c41b73a 100644 --- a/frontend/src/components/LoginView.vue +++ b/frontend/src/components/LoginView.vue @@ -26,7 +26,10 @@ const handleLogin = async () => { authStore.showMessage('Starting authentication...', 'info') await authStore.authenticate() authStore.showMessage('Authentication successful!', 'success', 2000) - if (location.pathname.startsWith('/auth/')) { + if (authStore.restrictedMode) { + // In restricted mode after successful auth show permission denied (no profile outside /auth/) + authStore.currentView = 'permission-denied' + } else if (location.pathname.startsWith('/auth/')) { authStore.currentView = 'profile' } else { location.reload() diff --git a/frontend/src/components/PermissionDeniedView.vue b/frontend/src/components/PermissionDeniedView.vue new file mode 100644 index 0000000..a68bbce --- /dev/null +++ b/frontend/src/components/PermissionDeniedView.vue @@ -0,0 +1,44 @@ + + +