diff --git a/core/js/custom-login.js b/core/js/custom-login.js index 12b6ad6b0b93fa6c171a7d8aef2260b27e349a06..6410cc961d07d1745357b010c52633446386ad73 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.closest('.login-form__link')) { + window.location.href = '/login'; + } + // 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 = '/login'; + } + }); if (window.location.href.includes("?showResetPassword=1")) { var elementLostPassword = document.getElementById("lost-password"); if (elementLostPassword) {