Skip to content

Commit

Permalink
standardize webauthn initiation button
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-jackson committed Feb 6, 2025
1 parent 59a1dcd commit ccefdd8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 21 deletions.
2 changes: 1 addition & 1 deletion modules/material/locales/en/LC_MESSAGES/material.po
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ msgid "{mfa:webauthn_instructions}"
msgstr "Follow the prompts to use your key."

msgid "{mfa:webauthn_start}"
msgstr "Click OK when you're ready to start."
msgstr "Click Verify when you're ready to start."

msgid "{mfa:webauthn_error_unknown}"
msgstr "Something went wrong with that request, unable to verify at this time."
Expand Down
2 changes: 1 addition & 1 deletion modules/material/locales/es/LC_MESSAGES/material.po
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ msgid "{mfa:webauthn_instructions}"
msgstr "Siga las instrucciones para usar su clave."

msgid "{mfa:webauthn_start}"
msgstr "Haga clic en OK cuando esté listo para comenzar."
msgstr "Haga clic en Verificar cuando esté listo para comenzar."

msgid "{mfa:webauthn_error_unknown}"
msgstr "Algo salió mal con esa solicitud, no se pudo verificar en este momento."
Expand Down
2 changes: 1 addition & 1 deletion modules/material/locales/fr/LC_MESSAGES/material.po
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ msgid "{mfa:webauthn_instructions}"
msgstr "Suivez les instructions pour utiliser votre clé."

msgid "{mfa:webauthn_start}"
msgstr "Cliquez sur OK lorsque vous êtes prêt à commencer."
msgstr "Cliquez sur Vérifier lorsque vous êtes prêt à commencer."

msgid "{mfa:webauthn_error_unknown}"
msgstr "Quelque chose s'est mal passé avec cette demande, impossible de vérifier pour le moment."
Expand Down
21 changes: 3 additions & 18 deletions modules/material/themes/material/mfa/prompt-for-mfa-webauthn.twig
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
const errorNode = document.querySelector('p.error');
errorNode.classList.remove('hide');
errorNode.querySelector('span').textContent = errorMessage;
offerRetry();
}
function createMessage(error) {
Expand All @@ -37,15 +35,6 @@
}
}
function offerRetry() {
const verifyBtn = document.getElementById('verifyBtn');
verifyBtn.classList.add('mdl-color-text--red');
verifyBtn.classList.remove('mdl-color-text--primary');
verifyBtn.textContent = '{{ '{mfa:button_try_again}'|trans|e('js') }}';
}
function submitForm(webAuthnResponse) {
const form = document.querySelector('form');
const submissionInput = createHiddenInput('submitMfa');
Expand Down Expand Up @@ -126,14 +115,10 @@
{{ include('other_mfas.twig') }}

<span flex></span>

<!-- used type=button to avoid form submission on click -->
<button
id="verifyBtn"
type="button"
class="mdl-button mdl-button--raised {{ error_message is empty ? 'mdl-color-text--primary' : 'mdl-color-text--red' }}"
>
{{ error_message is empty ? 'ok' : '{mfa:button_try_again}'|trans }}
<button id="verifyBtn" type="button" class="mdl-button mdl-button--raised mdl-button--primary">
{{ '{mfa:button_verify}'|trans }}
</button>
</div>

Expand Down

0 comments on commit ccefdd8

Please sign in to comment.