diff --git a/modules/material/themes/material/mfa/prompt-for-mfa-backupcode.twig b/modules/material/themes/material/mfa/prompt-for-mfa-backupcode.twig index e16ef2d6..42b5ecdb 100644 --- a/modules/material/themes/material/mfa/prompt-for-mfa-backupcode.twig +++ b/modules/material/themes/material/mfa/prompt-for-mfa-backupcode.twig @@ -4,6 +4,8 @@ {{ '{mfa:title}'|trans }} {{ include('header.twig') }} + +
@@ -74,11 +76,11 @@
-
diff --git a/modules/material/themes/material/mfa/prompt-for-mfa-manager.twig b/modules/material/themes/material/mfa/prompt-for-mfa-manager.twig index 74db6ec0..366950c4 100644 --- a/modules/material/themes/material/mfa/prompt-for-mfa-manager.twig +++ b/modules/material/themes/material/mfa/prompt-for-mfa-manager.twig @@ -4,6 +4,8 @@ {{ '{mfa:title}'|trans }} {{ include('header.twig') }} + +
@@ -74,11 +76,11 @@
-
diff --git a/modules/material/themes/material/mfa/prompt-for-mfa-totp.twig b/modules/material/themes/material/mfa/prompt-for-mfa-totp.twig index 41bf21cc..47815d0c 100644 --- a/modules/material/themes/material/mfa/prompt-for-mfa-totp.twig +++ b/modules/material/themes/material/mfa/prompt-for-mfa-totp.twig @@ -4,6 +4,8 @@ {{ '{mfa:title}'|trans }} {{ include('header.twig') }} + +
@@ -72,11 +74,11 @@
-
diff --git a/modules/material/themes/material/mfa/prompt-for-mfa-webauthn.twig b/modules/material/themes/material/mfa/prompt-for-mfa-webauthn.twig index 779b8ad8..3b714940 100644 --- a/modules/material/themes/material/mfa/prompt-for-mfa-webauthn.twig +++ b/modules/material/themes/material/mfa/prompt-for-mfa-webauthn.twig @@ -69,6 +69,8 @@ verifyWebAuthn(); }); + + @@ -135,11 +137,11 @@
-
diff --git a/modules/mfa/public/prompt-for-mfa.php b/modules/mfa/public/prompt-for-mfa.php index 29530c7b..9d9038f3 100644 --- a/modules/mfa/public/prompt-for-mfa.php +++ b/modules/mfa/public/prompt-for-mfa.php @@ -125,6 +125,7 @@ $t->data['mfa_options'] = $mfaOptions; $browserJsHash = md5_file(__DIR__ . '/simplewebauthn/browser.js'); $t->data['browser_js_path'] = '/module.php/mfa/simplewebauthn/browser.js?v=' . $browserJsHash; +$t->data['remember_me_js_path'] = '/module.php/mfa/public/remember-me.js'; $t->data['manager_email'] = $state['managerEmail']; $t->data['other_options'] = $otherOptions; $t->data['idp_name'] = $t->getEntityDisplayName($state['IdPMetadata']); diff --git a/modules/mfa/public/remember-me.js b/modules/mfa/public/remember-me.js new file mode 100644 index 00000000..3683e3a8 --- /dev/null +++ b/modules/mfa/public/remember-me.js @@ -0,0 +1,14 @@ +document.addEventListener('DOMContentLoaded', function() { + const rememberMeCheckbox = document.getElementById('rememberMe'); + + if (rememberMeCheckbox) { + const desiredRememberMeState = localStorage.getItem('desiredRememberMeState'); + if (desiredRememberMeState === 'true') { + rememberMeCheckbox.checked = true; + } + + rememberMeCheckbox.addEventListener('change', function() { + localStorage.setItem('desiredRememberMeState', rememberMeCheckbox.checked); + }); + } +});