Skip to content

Commit

Permalink
Merge branch 'MDL-81285' of https://github.com/paulholden/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Nov 14, 2024
2 parents 6c14a8a + fae40c0 commit 1b7b121
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion admin/tool/mfa/factor/webauthn/amd/build/register.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions admin/tool/mfa/factor/webauthn/amd/src/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,11 @@

define([
'factor_webauthn/utils',
'core/log',
'core/prefetch',
'core/str',
'core/toast',
], function(
utils,
Log,
Prefetch,
Str,
Toast,
Expand Down Expand Up @@ -68,7 +66,8 @@ define([
// Enable the submit button so that we can proceed.
document.getElementById('id_submitbutton').disabled = false;
} catch (e) {
Log.debug('The request timed out or you have canceled the request. Please try again later.');
const registerError = await Str.getString('registererror', 'factor_webauthn', e.message);
await Toast.add(registerError, {type: 'warning'});
}
}

Expand All @@ -79,6 +78,7 @@ define([

Prefetch.prefetchStrings('factor_webauthn', [
'registersuccess',
'registererror',
]);

// Register event listeners.
Expand Down
1 change: 1 addition & 0 deletions admin/tool/mfa/factor/webauthn/lang/en/factor_webauthn.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
$string['pluginname'] = 'Security key';
$string['privacy:metadata'] = 'The Security key factor plugin does not store any personal data.';
$string['register'] = 'Register security key';
$string['registererror'] = 'Couldn\'t register security key: {$a}';
$string['registersuccess'] = 'Registered security key';
$string['replacefactor'] = 'Replace security key';
$string['replacefactorconfirmation'] = 'Replace \'{$a}\' security key?';
Expand Down

0 comments on commit 1b7b121

Please sign in to comment.