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

Commit a12d2e18 authored by Akhil's avatar Akhil 🙂
Browse files

Merge branch 'dev/fix-sso-redirect' into 'main'

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

See merge request !214
parents 52a0c5d3 d7384453
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) {