diff options
Diffstat (limited to 'app/assets/javascripts/pages/profiles/two_factor_auths/index.js')
-rw-r--r-- | app/assets/javascripts/pages/profiles/two_factor_auths/index.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/assets/javascripts/pages/profiles/two_factor_auths/index.js b/app/assets/javascripts/pages/profiles/two_factor_auths/index.js index 1aeba6669ee..24dbc312dd2 100644 --- a/app/assets/javascripts/pages/profiles/two_factor_auths/index.js +++ b/app/assets/javascripts/pages/profiles/two_factor_auths/index.js @@ -1,9 +1,10 @@ import { parseBoolean } from '~/lib/utils/common_utils'; import { mount2faRegistration } from '~/authentication/mount_2fa'; +import { initRecoveryCodes } from '~/authentication/two_factor_auth'; document.addEventListener('DOMContentLoaded', () => { const twoFactorNode = document.querySelector('.js-two-factor-auth'); - const skippable = parseBoolean(twoFactorNode.dataset.twoFactorSkippable); + const skippable = twoFactorNode ? parseBoolean(twoFactorNode.dataset.twoFactorSkippable) : false; if (skippable) { const button = `<a class="btn btn-sm btn-warning float-right" data-qa-selector="configure_it_later_button" data-method="patch" href="${twoFactorNode.dataset.two_factor_skip_url}">Configure it later</a>`; @@ -13,3 +14,5 @@ document.addEventListener('DOMContentLoaded', () => { mount2faRegistration(); }); + +initRecoveryCodes(); |