summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLogan Fick <logaldeveloper@protonmail.com>2018-06-07 21:51:54 -0400
committerLogan Fick <logaldeveloper@protonmail.com>2018-06-07 21:51:54 -0400
commite8038a5416b55a022be3bb78f19b0f712a0c94ce (patch)
tree59243fd6e86be1fa90e5598aeaecb1597dfd3af5
parente3eaccd430030ebaf61823ac1e6da0fad05e04a5 (diff)
Fixed 2FA enforcement on login screen.
-rw-r--r--app/controllers/sessions_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index 2681320..cb8dcef 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -21,7 +21,7 @@ class SessionsController < ApplicationController
flash[:alert] = "Your account has been disabled!"
elsif user.banned?
flash[:alert] = "You are banned!"
- elsif user.totp_enabled && !TOTP.valid?(user.totp_code, params[:totp_code])
+ elsif user.totp_enabled && !TOTP.valid?(user.totp_secret, params[:totp_code].to_i)
flash[:alert] = "You're doing it wrong!"
render action: 'new'
return