Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d7384453 authored by AVINASH GUSAIN's avatar AVINASH GUSAIN Committed by Akhil
Browse files

feat(login): redirect to OIDC when login link or passwordless back button is clicked

parent 52a0c5d3
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -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) {