summaryrefslogtreecommitdiff
path: root/app/views/devise
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2016-06-06 10:20:39 +0530
committerTimothy Andrew <mail@timothyandrew.net>2016-06-06 12:50:31 +0530
commit86b07caa599a7f064e9077770b1a87c670d7607c (patch)
tree21717ae881f78fddccab7de6fcb817dcdfc1da65 /app/views/devise
parent128549f10beb406333fa23c1693750c06ff7bc4a (diff)
downloadgitlab-ce-86b07caa599a7f064e9077770b1a87c670d7607c.tar.gz
Implement authentication (login) using a U2F device.
- Move the `authenticate_with_two_factor` method from `ApplicationController` to the `AuthenticatesWithTwoFactor` module, where it should be.
Diffstat (limited to 'app/views/devise')
-rw-r--r--app/views/devise/sessions/two_factor.html.haml21
1 files changed, 14 insertions, 7 deletions
diff --git a/app/views/devise/sessions/two_factor.html.haml b/app/views/devise/sessions/two_factor.html.haml
index fd5937a45ce..9d04db2c45e 100644
--- a/app/views/devise/sessions/two_factor.html.haml
+++ b/app/views/devise/sessions/two_factor.html.haml
@@ -1,11 +1,18 @@
%div
.login-box
.login-heading
- %h3 Two-factor Authentication
+ %h3 Two-Factor Authentication
.login-body
- = form_for(resource, as: resource_name, url: session_path(resource_name), method: :post) do |f|
- = f.hidden_field :remember_me, value: params[resource_name][:remember_me]
- = f.text_field :otp_attempt, class: 'form-control', placeholder: 'Two-factor Authentication code', required: true, autofocus: true, autocomplete: 'off'
- %p.help-block.hint Enter the code from the two-factor app on your mobile device. If you've lost your device, you may enter one of your recovery codes.
- .prepend-top-20
- = f.submit "Verify code", class: "btn btn-save"
+ - if @user.two_factor_otp_enabled?
+ %h5 Authenticate via Two-Factor App
+ = form_for(resource, as: resource_name, url: session_path(resource_name), method: :post) do |f|
+ = f.hidden_field :remember_me, value: params[resource_name][:remember_me]
+ = f.text_field :otp_attempt, class: 'form-control', placeholder: 'Two-Factor Authentication code', required: true, autofocus: true, autocomplete: 'off'
+ %p.help-block.hint Enter the code from the two-factor app on your mobile device. If you've lost your device, you may enter one of your recovery codes.
+ .prepend-top-20
+ = f.submit "Verify code", class: "btn btn-save"
+
+ - if @user.two_factor_u2f_enabled?
+
+ %hr
+ = render "u2f/authenticate"