forked from platypush/platypush
[UI] Redirect URIs should always be relative to the current host.
This commit is contained in:
parent
fe2497577d
commit
8904e40f9f
1 changed files with 4 additions and 4 deletions
|
@ -42,18 +42,18 @@ export default {
|
|||
// No users present -> redirect to the registration page
|
||||
if (
|
||||
error?.response?.data?.code === 412 &&
|
||||
window.location.href.indexOf('/register') < 0
|
||||
window.location.pathname !== '/register'
|
||||
) {
|
||||
window.location.href = '/register?redirect=' + window.location.href
|
||||
window.location.href = '/register?redirect=' + window.location.href.split('/').slice(3).join('/')
|
||||
return
|
||||
}
|
||||
|
||||
// Unauthorized -> redirect to the login page
|
||||
if (
|
||||
error?.response?.data?.code === 401 &&
|
||||
window.location.href.indexOf('/login') < 0
|
||||
window.location.pathname !== '/login'
|
||||
) {
|
||||
window.location.href = '/login?redirect=' + window.location.href
|
||||
window.location.href = '/login?redirect=' + window.location.href.split('/').slice(3).join('/')
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue