From 8904e40f9f651d04177f07640d3e8b46ac78c570 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 22 Jul 2024 21:48:07 +0200 Subject: [PATCH] [UI] Redirect URIs should always be relative to the current host. --- platypush/backend/http/webapp/src/utils/Api.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 }