diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2016-07-11 10:30:22 +0300 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2016-07-14 05:49:09 +0300 |
commit | 4b33c4c6d1aa529ec22606995123cfa3a151ccee (patch) | |
tree | 3b8a555e88995454e9db663bd35cd5c3eb5ab6f8 /app/assets/javascripts/u2f | |
parent | df49492fc011bd74ebaa4cb82bd85252127859a0 (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.erb | 14 |
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 |