Fixed 2FA enforcement on login screen.

This commit is contained in:
Logan Fick
2018-06-07 21:51:54 -04:00
parent e3eaccd430
commit e8038a5416

View File

@@ -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