Commit b631a8ea authored by Paul Slaughter's avatar Paul Slaughter

Merge branch 'move-u2f-into-shared-folder' into 'master'

Move U2F frontend code into shared authentication folder

See merge request gitlab-org/gitlab!33208
parents 64d9372f 11c04a00
import $ from 'jquery';
import initU2F from './u2f';
import U2FRegister from './u2f/register';
export const mount2faAuthentication = () => {
// Soon this will conditionally mount a webauthn app (see https://gitlab.com/gitlab-org/gitlab/-/merge_requests/26692)
initU2F();
};
export const mount2faRegistration = () => {
// Soon this will conditionally mount a webauthn app (see https://gitlab.com/gitlab-org/gitlab/-/merge_requests/26692)
const u2fRegister = new U2FRegister($('#js-register-u2f'), gon.u2f);
u2fRegister.start();
};
import $ from 'jquery';
import U2FAuthenticate from '../../u2f/authenticate';
import U2FAuthenticate from './authenticate';
export default () => {
if (!gon.u2f) return;
......@@ -12,6 +12,6 @@ export default () => {
document.querySelector('.js-2fa-form'),
);
u2fAuthenticate.start();
// needed in rspec
// needed in rspec (FakeU2fDevice)
gl.u2fAuthenticate = u2fAuthenticate;
};
import initU2F from '../../../shared/sessions/u2f';
import { mount2faAuthentication } from '~/authentication/mount_2fa';
document.addEventListener('DOMContentLoaded', initU2F);
document.addEventListener('DOMContentLoaded', mount2faAuthentication);
import initU2F from '../../shared/sessions/u2f';
import { mount2faAuthentication } from '~/authentication/mount_2fa';
document.addEventListener('DOMContentLoaded', initU2F);
document.addEventListener('DOMContentLoaded', mount2faAuthentication);
import $ from 'jquery';
import U2FRegister from '~/u2f/register';
import { parseBoolean } from '~/lib/utils/common_utils';
import { mount2faRegistration } from '~/authentication/mount_2fa';
document.addEventListener('DOMContentLoaded', () => {
const twoFactorNode = document.querySelector('.js-two-factor-auth');
......@@ -12,6 +11,5 @@ document.addEventListener('DOMContentLoaded', () => {
if (flashAlert) flashAlert.insertAdjacentHTML('beforeend', button);
}
const u2fRegister = new U2FRegister($('#js-register-u2f'), gon.u2f);
u2fRegister.start();
mount2faRegistration();
});
import initU2F from '../../shared/sessions/u2f';
import { mount2faAuthentication } from '~/authentication/mount_2fa';
document.addEventListener('DOMContentLoaded', initU2F);
document.addEventListener('DOMContentLoaded', mount2faAuthentication);
import initU2F from '~/shared/sessions/u2f';
import { mount2faAuthentication } from '~/authentication/mount_2fa';
document.addEventListener('DOMContentLoaded', initU2F);
document.addEventListener('DOMContentLoaded', mount2faAuthentication);
import $ from 'jquery';
import U2FAuthenticate from '~/u2f/authenticate';
import U2FAuthenticate from '~/authentication/u2f/authenticate';
import 'vendor/u2f';
import MockU2FDevice from './mock_u2f_device';
......
import $ from 'jquery';
import U2FRegister from '~/u2f/register';
import U2FRegister from '~/authentication/u2f/register';
import 'vendor/u2f';
import MockU2FDevice from './mock_u2f_device';
......
import { canInjectU2fApi } from '~/u2f/util';
import { canInjectU2fApi } from '~/authentication/u2f/util';
describe('U2F Utils', () => {
describe('canInjectU2fApi', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment