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 <rspeicher@gmail.com>2015-09-20 04:16:18 +0300
committerRobert Speicher <rspeicher@gmail.com>2015-09-20 04:16:18 +0300
commit259851c0d601632ad02a9f6ac0d59276552570b9 (patch)
treeee51f875433e2df76f88a1ae8bad83225afe6400 /app/controllers
parent69723d20024821fb4206e899ffa3acd2da690315 (diff)
Bump devise-two-factor to 2.0.0
Addresses internal https://dev.gitlab.org/gitlab/gitlabhq/issues/2605 See https://github.com/tinfoil/devise-two-factor/pull/43
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/profiles/two_factor_auths_controller.rb2
-rw-r--r--app/controllers/sessions_controller.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/profiles/two_factor_auths_controller.rb b/app/controllers/profiles/two_factor_auths_controller.rb
index f9af0871cf1..e6b99be37fb 100644
--- a/app/controllers/profiles/two_factor_auths_controller.rb
+++ b/app/controllers/profiles/two_factor_auths_controller.rb
@@ -9,7 +9,7 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController
end
def create
- if current_user.valid_otp?(params[:pin_code])
+ if current_user.validate_and_consume_otp!(params[:pin_code])
current_user.two_factor_enabled = true
@codes = current_user.generate_otp_backup_codes!
current_user.save!
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index cfa565cd03e..1b60d3e27d0 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -99,7 +99,7 @@ class SessionsController < Devise::SessionsController
end
def valid_otp_attempt?(user)
- user.valid_otp?(user_params[:otp_attempt]) ||
+ user.validate_and_consume_otp!(user_params[:otp_attempt]) ||
user.invalidate_otp_backup_code!(user_params[:otp_attempt])
end