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:
parent
fb8adade60
commit
8ff0b3f9e7
@ -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 = '/'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user