From 7d03a4c48c5a9f6403f28660c193c24b5c6ea2da Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 13 Jul 2023 13:14:20 +0530 Subject: [PATCH 1/3] login with device --- core/js/custom-login.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/core/js/custom-login.js b/core/js/custom-login.js index a3f4fa9e..2e6db9eb 100644 --- a/core/js/custom-login.js +++ b/core/js/custom-login.js @@ -19,3 +19,18 @@ document.addEventListener('DOMContentLoaded', function() { } }) }) +if (window.location.href.includes("?showResetPassword=1")) { + var elementLostPassword = document.getElementById("lost-password"); + if (elementLostPassword) { + elementLostPassword.click(); + } +} +if (window.location.href.includes("?showLoginWithDevice=1")) { + var targetHref = '#'; + var targetText = 'Log in with a device'; + var element = document.querySelector('a[href="' + targetHref + '"]:contains("' + targetText + '")'); + if (element) { + element.click(); + } +} + -- GitLab From 99185ec50df91eec51946e09735355c7788d1a46 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Tue, 18 Jul 2023 10:18:16 +0530 Subject: [PATCH 2/3] removed code --- core/js/custom-login.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/core/js/custom-login.js b/core/js/custom-login.js index 2e6db9eb..2b286b18 100644 --- a/core/js/custom-login.js +++ b/core/js/custom-login.js @@ -25,12 +25,3 @@ if (window.location.href.includes("?showResetPassword=1")) { elementLostPassword.click(); } } -if (window.location.href.includes("?showLoginWithDevice=1")) { - var targetHref = '#'; - var targetText = 'Log in with a device'; - var element = document.querySelector('a[href="' + targetHref + '"]:contains("' + targetText + '")'); - if (element) { - element.click(); - } -} - -- GitLab From 730009fda180de930acb33edc37d5bef01abe79d Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Fri, 21 Jul 2023 15:23:46 +0530 Subject: [PATCH 3/3] dom loaded --- core/js/custom-login.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/core/js/custom-login.js b/core/js/custom-login.js index 2b286b18..6d0a50bd 100644 --- a/core/js/custom-login.js +++ b/core/js/custom-login.js @@ -18,10 +18,12 @@ document.addEventListener('DOMContentLoaded', function() { document.querySelector('.banner-content').classList.add('slow-show') } }) + + if (window.location.href.includes("?showResetPassword=1")) { + var elementLostPassword = document.getElementById("lost-password"); + if (elementLostPassword) { + elementLostPassword.click(); + } + } }) -if (window.location.href.includes("?showResetPassword=1")) { - var elementLostPassword = document.getElementById("lost-password"); - if (elementLostPassword) { - elementLostPassword.click(); - } -} + -- GitLab