diff --git a/src/openforms/js/components/admin/login.js b/src/openforms/js/components/admin/login.js index d83cd92a59..0b8b458abb 100644 --- a/src/openforms/js/components/admin/login.js +++ b/src/openforms/js/components/admin/login.js @@ -5,11 +5,22 @@ const addAdminLoginExpand = () => { const loginForm = document.querySelector('#login-form'); if (defaultLoginToggle && loginForm) { - defaultLoginToggle.addEventListener('click', e => { - e.preventDefault(); + const showLoginForm = () => { loginForm.classList.toggle('login-form--enabled'); defaultLoginToggle.classList.toggle('admin-login-option--disabled'); + }; + + // bind click event + defaultLoginToggle.addEventListener('click', e => { + e.preventDefault(); + showLoginForm(); }); + + // if the form is bound, there is feedback, so toggle it to visible + const {bound, wizardstep} = defaultLoginToggle.dataset; + if (bound === 'true' || wizardstep !== 'auth') { + showLoginForm(); + } } }; diff --git a/src/openforms/templates/maykin_2fa/login.html b/src/openforms/templates/maykin_2fa/login.html index c0e0b138d1..791a63ea07 100644 --- a/src/openforms/templates/maykin_2fa/login.html +++ b/src/openforms/templates/maykin_2fa/login.html @@ -4,9 +4,15 @@ {% block extra_login_options %} {% get_solo 'mozilla_django_oidc_db.OpenIDConnectConfig' as oidc_config %} {% if oidc_config.enabled %} -
+ +
{% trans "Login with application account" %}
+
{% trans "or" %}
{% trans "Login with organization account" %}