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:
authorRobert Speicher <robert@gitlab.com>2016-06-09 21:43:22 +0300
committerRobert Speicher <robert@gitlab.com>2016-06-09 21:43:22 +0300
commit8138f340f81d5144290893a7fc6897d9a502bbdb (patch)
treeb991ded0977012d3ee0b661b2fc3f77337e4307d /app/views/devise
parent95de1c1a6a2beca8282ee715470206ebbfdcfa0c (diff)
parent9f554aadd585e357c77a22733c82f381967cac1d (diff)
Merge branch 'rs-fix-ldap-2fa-login' into 'master'
Fix 2FA-based login for LDAP users The OTP input form is shared by both LDAP and standard logins, but when coming from an LDAP-based form, the form parameters aren't nested in a Hash based on the `resource_name` value. Now we check for a nested `remember_me` parameter and use that if it exists, or fall back to the non-nested parameters if it doesn't. Somewhat confusingly, the OTP input form _does_ nest parameters under the `resource_name`, regardless of what type of login we're coming from, so that allows everything else to work as normal. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/18185 See merge request !4493
Diffstat (limited to 'app/views/devise')
-rw-r--r--app/views/devise/sessions/two_factor.html.haml3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/views/devise/sessions/two_factor.html.haml b/app/views/devise/sessions/two_factor.html.haml
index 9d04db2c45e..a373f61bd3c 100644
--- a/app/views/devise/sessions/two_factor.html.haml
+++ b/app/views/devise/sessions/two_factor.html.haml
@@ -6,7 +6,8 @@
- 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]
+ - resource_params = params[resource_name].presence || params
+ = f.hidden_field :remember_me, value: resource_params.fetch(:remember_me, 0)
= 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