Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2016-07-11 10:30:22 +0300
committerTimothy Andrew <mail@timothyandrew.net>2016-07-14 05:49:09 +0300
commit4b33c4c6d1aa529ec22606995123cfa3a151ccee (patch)
tree3b8a555e88995454e9db663bd35cd5c3eb5ab6f8 /app/assets/javascripts/u2f
parentdf49492fc011bd74ebaa4cb82bd85252127859a0 (diff)
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/assets/javascripts/u2f')
-rw-r--r--app/assets/javascripts/u2f/util.js.coffee.erb14
1 files changed, 1 insertions, 13 deletions
diff --git a/app/assets/javascripts/u2f/util.js.coffee.erb b/app/assets/javascripts/u2f/util.js.coffee.erb
index d59341c38b9..be1d3286b01 100644
--- a/app/assets/javascripts/u2f/util.js.coffee.erb
+++ b/app/assets/javascripts/u2f/util.js.coffee.erb
@@ -1,15 +1,3 @@
-# Helper class for U2F (universal 2nd factor) device registration and authentication.
-
class @U2FUtil
@isU2FSupported: ->
- if @testMode
- true
- else
- gon.u2f.browser_supports_u2f
-
- @enableTestMode: ->
- @testMode = true
-
-<% if Rails.env.test? %>
-U2FUtil.enableTestMode();
-<% end %>
+ window.u2f