Added TOTP 2FA support. #50

Merged
LogalDeveloper merged 12 commits from totp-feature into master 2018-06-10 21:08:56 -04:00
Showing only changes of commit 1d1b66f4a0 - Show all commits
+1 -1
View File
@@ -21,7 +21,7 @@ class SessionsController < ApplicationController
flash[:alert] = "Your account has been disabled!" flash[:alert] = "Your account has been disabled!"
elsif user.banned? elsif user.banned?
flash[:alert] = "You are banned!" flash[:alert] = "You are banned!"
elsif user.totp_enabled && !TOTP.verify?(user.totp_code, params[:totp_code]) elsif user.totp_enabled && !TOTP.valid?(user.totp_code, params[:totp_code])
flash[:alert] = "You're doing it wrong!" flash[:alert] = "You're doing it wrong!"
render action: 'new' render action: 'new'
return return