diff options
Diffstat (limited to 'app/assets/javascripts/authentication/webauthn/registration.js')
-rw-r--r-- | app/assets/javascripts/authentication/webauthn/registration.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/app/assets/javascripts/authentication/webauthn/registration.js b/app/assets/javascripts/authentication/webauthn/registration.js new file mode 100644 index 00000000000..67906a24857 --- /dev/null +++ b/app/assets/javascripts/authentication/webauthn/registration.js @@ -0,0 +1,22 @@ +import Vue from 'vue'; +import WebAuthnRegistration from '~/authentication/webauthn/components/registration.vue'; +import { parseBoolean } from '~/lib/utils/common_utils'; + +export const initWebAuthnRegistration = () => { + const el = document.querySelector('#js-device-registration'); + + if (!el) { + return null; + } + + const { initialError, passwordRequired, targetPath } = el.dataset; + + return new Vue({ + el, + name: 'WebAuthnRegistrationRoot', + provide: { initialError, passwordRequired: parseBoolean(passwordRequired), targetPath }, + render(h) { + return h(WebAuthnRegistration); + }, + }); +}; |