summaryrefslogtreecommitdiff
path: root/app/views/devise
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2016-07-11 13:00:22 +0530
committerTimothy Andrew <mail@timothyandrew.net>2016-07-14 08:19:09 +0530
commit4b33c4c6d1aa529ec22606995123cfa3a151ccee (patch)
tree3b8a555e88995454e9db663bd35cd5c3eb5ab6f8 /app/views/devise
parentdf49492fc011bd74ebaa4cb82bd85252127859a0 (diff)
downloadgitlab-ce-4b33c4c6d1aa529ec22606995123cfa3a151ccee.tar.gz
Load Javascript U2F library selectively.
1. Only on supported Chrome versions 2. Mainly, this lets us simplify the javascript-based U2F check to `window.u2f`, where `window.u2f` can either be loaded from the GitLab server (for Chrome) or from the Firefox extension. 3. This is a better way to provide browser detection for U2F.
Diffstat (limited to 'app/views/devise')
-rw-r--r--app/views/devise/sessions/two_factor.html.haml4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/views/devise/sessions/two_factor.html.haml b/app/views/devise/sessions/two_factor.html.haml
index a373f61bd3c..dbf4d699d01 100644
--- a/app/views/devise/sessions/two_factor.html.haml
+++ b/app/views/devise/sessions/two_factor.html.haml
@@ -1,3 +1,7 @@
+- content_for :page_specific_javascripts do
+ - if inject_u2f_api?
+ = page_specific_javascript_tag('u2f.js')
+
%div
.login-box
.login-heading