bugfix: use external redirects for navigateTo() is bound to fail with DOMException if two consecutive redirects happen (at least in docker container)

This commit is contained in:
Settel 2022-09-25 17:23:27 +02:00
parent fb8adade60
commit 8ff0b3f9e7

View File

@ -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 = '/'
}
}
},