diff --git a/src/ExternalApp.vue b/src/ExternalApp.vue
new file mode 100644
index 0000000000..69195a27e8
--- /dev/null
+++ b/src/ExternalApp.vue
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/RightSidebar/RightSidebar.vue b/src/components/RightSidebar/RightSidebar.vue
index cd0f3f1fc9..b0e0b20d02 100644
--- a/src/components/RightSidebar/RightSidebar.vue
+++ b/src/components/RightSidebar/RightSidebar.vue
@@ -3,8 +3,9 @@
- SPDX-License-Identifier: AGPL-3.0-or-later
-->
- ({
show: false,
activeTab: '',
- sidebarRoutes: ['fileslist', 'SignPDF', 'ValidationFile', 'IdDocsApprove'],
+ sidebarRoutes: ['fileslist', 'SignPDF', 'SignPDFExternal', 'ValidationFile', 'IdDocsApprove'],
}),
getters: {
diff --git a/src/tests/components/Settings/Settings.spec.ts b/src/tests/components/Settings/Settings.spec.ts
index e8ea29b8c1..4b8b4e7ca2 100644
--- a/src/tests/components/Settings/Settings.spec.ts
+++ b/src/tests/components/Settings/Settings.spec.ts
@@ -258,6 +258,54 @@ describe('Settings', () => {
})
})
+ describe('RULE: unauthenticated users (signing via email link) do not crash the component', () => {
+ const createUnauthenticatedWrapper = () => {
+ getCurrentUserMock.mockReturnValue(null)
+
+ return mount(Settings, {
+ global: {
+ stubs: {
+ NcAppNavigationItem: {
+ name: 'NcAppNavigationItem',
+ props: ['name', 'to', 'href', 'icon'],
+ template: '{{ name }}',
+ },
+ AccountIcon: { template: '' },
+ StarIcon: { template: '' },
+ TuneIcon: { template: '' },
+ },
+ mocks: { t },
+ },
+ })
+ }
+
+ it('mounts without throwing when getCurrentUser returns null', () => {
+ expect(() => createUnauthenticatedWrapper()).not.toThrow()
+ })
+
+ it('isAdmin is false when getCurrentUser returns null', () => {
+ wrapper = createUnauthenticatedWrapper()
+
+ expect(getWrapper().vm.isAdmin).toBe(false)
+ })
+
+ it('hides the Administration link when user is unauthenticated', () => {
+ wrapper = createUnauthenticatedWrapper()
+ const items = getItems()
+ const adminItem = findItemByName(items, 'Administration')
+
+ expect(adminItem).toBeUndefined()
+ })
+
+ it('shows 2 navigation items for unauthenticated user', () => {
+ wrapper = createUnauthenticatedWrapper()
+ const items = getItems()
+
+ // Account + Rate = 2
+ expect(items.length).toBe(2)
+ })
+ })
+
describe('RULE: navigation items count depends on admin status', () => {
it('shows 2 items for non-admin', () => {
wrapper = createWrapper(false)
diff --git a/src/tests/store/sidebar.spec.ts b/src/tests/store/sidebar.spec.ts
index 7d16da7246..d870076ab8 100644
--- a/src/tests/store/sidebar.spec.ts
+++ b/src/tests/store/sidebar.spec.ts
@@ -213,6 +213,16 @@ describe('sidebar store - visibility rules', () => {
expect(store.show).toBe(true)
})
+ it('keeps sidebar visible for SignPDFExternal route', () => {
+ const store = useSidebarStore()
+ store.show = true
+ store.activeTab = 'sign-tab'
+
+ store.handleRouteChange('SignPDFExternal')
+
+ expect(store.show).toBe(true)
+ })
+
it('hides sidebar for non-allowed routes', () => {
const store = useSidebarStore()
store.show = true
diff --git a/src/views/SignPDF/SignPDF.vue b/src/views/SignPDF/SignPDF.vue
index 1bea844e73..ffff7f45b8 100644
--- a/src/views/SignPDF/SignPDF.vue
+++ b/src/views/SignPDF/SignPDF.vue
@@ -103,7 +103,7 @@ export default {
await this.initIdDocsApprove()
}
- if (this.isMobile){
+ if (this.isMobile && this.$route?.name !== 'SignPDFExternal') {
this.toggleSidebar();
}