From 8ff0b3f9e7374a9024c6338dabf996ef4499de3c Mon Sep 17 00:00:00 2001 From: Settel Date: Sun, 25 Sep 2022 17:23:27 +0200 Subject: [PATCH] bugfix: use external redirects for navigateTo() is bound to fail with DOMException if two consecutive redirects happen (at least in docker container) --- client/src/composables/useAuth.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/src/composables/useAuth.ts b/client/src/composables/useAuth.ts index 1d62b4e..0af94c9 100644 --- a/client/src/composables/useAuth.ts +++ b/client/src/composables/useAuth.ts @@ -23,13 +23,15 @@ export default (): useAuth => { return } if (user.isAdmin) { - navigateTo('/admin', { replace: true }) + document.location.pathname = '/admin' + // can't use navigateTo() for it fails with DOMException if two consecutive redirects happen (at least in docker container) + // navigateTo('/admin', { replace: true }) } else { - navigateTo('/play', { replace: true }) + document.location.pathname = '/play' } } catch (e) { if (allowRoles.indexOf('') == -1 ) { - navigateTo('/', { replace: true }) + document.location.pathname = '/' } } },