diff --git a/platypush/backend/http/webapp/src/utils/Api.vue b/platypush/backend/http/webapp/src/utils/Api.vue index 7c05344716..00d03cf20c 100644 --- a/platypush/backend/http/webapp/src/utils/Api.vue +++ b/platypush/backend/http/webapp/src/utils/Api.vue @@ -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 }