debian-mirror-gitlab/app/assets/javascripts/authentication/webauthn/registration.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
617 B
JavaScript
Raw Normal View History

2023-05-27 22:25:52 +05:30
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);
},
});
};