{{ code || '404' }}
+404
- {{ message || t('libresign', 'Page not found') }} + {{ t('libresign', 'Page not found') }}
-{{ paragth }}
-- {{ error }} -
+{{ paragrath }}
+diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index 5bddef84e7..c10d278383 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -260,6 +260,7 @@ public function signPdf(string $uuid): TemplateResponse { #[RequireSignRequestUuid] #[FrontpageRoute(verb: 'GET', url: '/p/sign/{uuid}')] public function sign(string $uuid): TemplateResponse { + $this->throwIfValidationPageNotAccessible(); $this->initialState->provideInitialState('action', JSActions::ACTION_SIGN); $this->initialState->provideInitialState('config', $this->accountService->getConfig($this->userSession->getUser()) diff --git a/src/helpers/SelectAction.js b/src/helpers/SelectAction.js index 034166f6db..ab31248d8d 100644 --- a/src/helpers/SelectAction.js +++ b/src/helpers/SelectAction.js @@ -37,6 +37,9 @@ export const selectAction = (action, to, from) => { case 5000: // ACTION_INCOMPLETE_SETUP return 'Incomplete' + external default: + if (loadState('libresign', 'error', false)) { + return 'DefaultPageError' + external + } break } } diff --git a/src/router/router.js b/src/router/router.js index ca66b65f8c..ef852a84bc 100644 --- a/src/router/router.js +++ b/src/router/router.js @@ -188,22 +188,24 @@ const router = new Router({ }) router.beforeEach((to, from, next) => { + const actionElement = document.querySelector('#initial-state-libresign-action') + let action + if (actionElement) { + action = selectAction(loadState('libresign', 'action', ''), to, from) + document.querySelector('#initial-state-libresign-action')?.remove() + } if (Object.hasOwn(to, 'name') && typeof to.name === 'string' && !to.name.endsWith('External') && isExternal(to, from)) { next({ name: to.name + 'External', params: to.params, }) + } else if (action !== undefined) { + next({ + name: action, + params: to.params, + }) } else { - const action = selectAction(loadState('libresign', 'action', ''), to, from) - if (action !== undefined) { - document.querySelector('#initial-state-libresign-action').remove() - next({ - name: action, - params: to.params, - }) - } else { - next() - } + next() } }) diff --git a/src/views/DefaultPageError.vue b/src/views/DefaultPageError.vue index 68e746b5f3..1ab5ede7e2 100644 --- a/src/views/DefaultPageError.vue +++ b/src/views/DefaultPageError.vue @@ -7,15 +7,13 @@
{{ paragth }}
-- {{ error }} -
+{{ paragrath }}
+