diff --git a/app/assets/javascripts/authentication/two_factor_auth/components/two_factor_action_confirm.vue b/app/assets/javascripts/authentication/two_factor_auth/components/two_factor_action_confirm.vue new file mode 100644 index 00000000000..4d8622aff58 --- /dev/null +++ b/app/assets/javascripts/authentication/two_factor_auth/components/two_factor_action_confirm.vue @@ -0,0 +1,118 @@ + + + diff --git a/app/assets/javascripts/authentication/two_factor_auth/index.js b/app/assets/javascripts/authentication/two_factor_auth/index.js index cec80335ba0..09bd917c078 100644 --- a/app/assets/javascripts/authentication/two_factor_auth/index.js +++ b/app/assets/javascripts/authentication/two_factor_auth/index.js @@ -3,6 +3,7 @@ import { parseBoolean } from '~/lib/utils/common_utils'; import { updateHistory, removeParams } from '~/lib/utils/url_utility'; import ManageTwoFactorForm from './components/manage_two_factor_form.vue'; import RecoveryCodes from './components/recovery_codes.vue'; +import TwoFactorActionConfirm from './components/two_factor_action_confirm.vue'; import { SUCCESS_QUERY_PARAM } from './constants'; export const initManageTwoFactorForm = () => { @@ -78,3 +79,29 @@ export const initClose2faSuccessMessage = () => { { once: true }, ); }; + +export const initTwoFactorConfirm = () => { + document.querySelectorAll('.js-two-factor-action-confirm').forEach((el) => { + const { buttonText, classes, message, method, passwordRequired, path, title, variant } = + el.dataset; + + // eslint-disable-next-line no-new + new Vue({ + el, + render(createElement) { + return createElement(TwoFactorActionConfirm, { + props: { + buttonText, + classes, + message, + method, + passwordRequired: parseBoolean(passwordRequired), + path, + title, + variant, + }, + }); + }, + }); + }); +}; diff --git a/app/assets/javascripts/authentication/webauthn/components/registration.vue b/app/assets/javascripts/authentication/webauthn/components/registration.vue index 84132a7d062..97a433f7385 100644 --- a/app/assets/javascripts/authentication/webauthn/components/registration.vue +++ b/app/assets/javascripts/authentication/webauthn/components/registration.vue @@ -139,7 +139,7 @@ export default {