From c1e798a63ebc14839abe25346421c2819ec1293d Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Mon, 11 Aug 2025 16:18:44 +0530 Subject: [PATCH 1/5] feat(login): redirect to OIDC when login link or passwordless back button is clicked --- core/js/custom-login.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/core/js/custom-login.js b/core/js/custom-login.js index 12b6ad6b..7c04c165 100644 --- a/core/js/custom-login.js +++ b/core/js/custom-login.js @@ -18,7 +18,20 @@ document.addEventListener('DOMContentLoaded', function() { document.querySelector('.banner-content').classList.add('slow-show') } }) - + // NEW: redirect ONLY when .login-form__link is clicked + document.addEventListener('click', function(event) { + if (event.target.classList.contains('login-form__link')) { + window.location.href = '/apps/oidc_login/oidc'; + } + // Look for the Back button only inside the passwordless login container + const backBtn = event.target.closest( + '.login-additional.login-passwordless button.button-vue--vue-tertiary.button-vue--wide[type="button"]' + ); + if (backBtn) { + event.preventDefault(); + window.location.href = '/apps/oidc_login/oidc'; + } + }); if (window.location.href.includes("?showResetPassword=1")) { var elementLostPassword = document.getElementById("lost-password"); if (elementLostPassword) { -- GitLab From 9a2fdaa2b6d573980392097fcb0676047813c019 Mon Sep 17 00:00:00 2001 From: AVINASH GUSAIN Date: Wed, 13 Aug 2025 11:56:31 +0530 Subject: [PATCH 2/5] Apply 1 suggestion(s) to 1 file(s) Co-authored-by: Fahim Salam Chowdhury --- core/js/custom-login.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/js/custom-login.js b/core/js/custom-login.js index 7c04c165..df711d7c 100644 --- a/core/js/custom-login.js +++ b/core/js/custom-login.js @@ -21,7 +21,7 @@ document.addEventListener('DOMContentLoaded', function() { // NEW: redirect ONLY when .login-form__link is clicked document.addEventListener('click', function(event) { if (event.target.classList.contains('login-form__link')) { - window.location.href = '/apps/oidc_login/oidc'; + window.location.href = '/'; } // Look for the Back button only inside the passwordless login container const backBtn = event.target.closest( -- GitLab From ae8c922ce7f43869affddacb319247797395dda2 Mon Sep 17 00:00:00 2001 From: AVINASH GUSAIN Date: Wed, 13 Aug 2025 11:56:40 +0530 Subject: [PATCH 3/5] Apply 1 suggestion(s) to 1 file(s) Co-authored-by: Fahim Salam Chowdhury --- core/js/custom-login.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/js/custom-login.js b/core/js/custom-login.js index df711d7c..f7f01241 100644 --- a/core/js/custom-login.js +++ b/core/js/custom-login.js @@ -29,7 +29,7 @@ document.addEventListener('DOMContentLoaded', function() { ); if (backBtn) { event.preventDefault(); - window.location.href = '/apps/oidc_login/oidc'; + window.location.href = '/'; } }); if (window.location.href.includes("?showResetPassword=1")) { -- GitLab From a56dbc0d91ed6c974fe86bea5835ef3adc98b570 Mon Sep 17 00:00:00 2001 From: AVINASH GUSAIN Date: Wed, 13 Aug 2025 14:04:52 +0530 Subject: [PATCH 4/5] Apply 1 suggestion(s) to 1 file(s) Co-authored-by: Ronak Patel --- core/js/custom-login.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/js/custom-login.js b/core/js/custom-login.js index f7f01241..d7701e87 100644 --- a/core/js/custom-login.js +++ b/core/js/custom-login.js @@ -20,7 +20,7 @@ document.addEventListener('DOMContentLoaded', function() { }) // NEW: redirect ONLY when .login-form__link is clicked document.addEventListener('click', function(event) { - if (event.target.classList.contains('login-form__link')) { + if (event.target.closest('.login-form__link')) { window.location.href = '/'; } // Look for the Back button only inside the passwordless login container -- GitLab From b128cfebe45b6a0158bbb5e52554820c615af19c Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Mon, 18 Aug 2025 17:20:40 +0530 Subject: [PATCH 5/5] fix: redirect users to sso login using /login --- core/js/custom-login.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/js/custom-login.js b/core/js/custom-login.js index d7701e87..6410cc96 100644 --- a/core/js/custom-login.js +++ b/core/js/custom-login.js @@ -21,7 +21,7 @@ document.addEventListener('DOMContentLoaded', function() { // NEW: redirect ONLY when .login-form__link is clicked document.addEventListener('click', function(event) { if (event.target.closest('.login-form__link')) { - window.location.href = '/'; + window.location.href = '/login'; } // Look for the Back button only inside the passwordless login container const backBtn = event.target.closest( @@ -29,7 +29,7 @@ document.addEventListener('DOMContentLoaded', function() { ); if (backBtn) { event.preventDefault(); - window.location.href = '/'; + window.location.href = '/login'; } }); if (window.location.href.includes("?showResetPassword=1")) { -- GitLab