summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/shared
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-01-22 10:51:18 +0000
committerPhil Hughes <me@iamphill.com>2018-01-22 10:51:18 +0000
commit208eb7d69790ad6842274cd46cf5a0e8006eb9f5 (patch)
treee847e29de7b3d66fff9570247eeb585526cb1e08 /app/assets/javascripts/shared
parent68cc9ea22daa8c13b2cb880dcde2606b6b5b43b6 (diff)
downloadgitlab-ce-208eb7d69790ad6842274cd46cf5a0e8006eb9f5.tar.gz
Added dispatcher imports for sessions routedispatcher-ph-more
Diffstat (limited to 'app/assets/javascripts/shared')
-rw-r--r--app/assets/javascripts/shared/sessions/u2f.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/assets/javascripts/shared/sessions/u2f.js b/app/assets/javascripts/shared/sessions/u2f.js
new file mode 100644
index 00000000000..1d075f7e872
--- /dev/null
+++ b/app/assets/javascripts/shared/sessions/u2f.js
@@ -0,0 +1,16 @@
+import U2FAuthenticate from '../../u2f/authenticate';
+
+export default () => {
+ if (!gon.u2f) return;
+
+ const u2fAuthenticate = new U2FAuthenticate(
+ $('#js-authenticate-u2f'),
+ '#js-login-u2f-form',
+ gon.u2f,
+ document.querySelector('#js-login-2fa-device'),
+ document.querySelector('.js-2fa-form'),
+ );
+ u2fAuthenticate.start();
+ // needed in rspec
+ gl.u2fAuthenticate = u2fAuthenticate;
+};