forked from External/greenlight
Added failed login logging (#2746)
This commit is contained in:
@ -79,8 +79,11 @@ class SessionsController < ApplicationController
|
||||
return switch_account_to_local(user) if !is_super_admin && auth_changed_to_local?(user)
|
||||
|
||||
# Check correct password was entered
|
||||
return redirect_to(signin_path, alert: I18n.t("invalid_credentials")) unless user.try(:authenticate,
|
||||
session_params[:password])
|
||||
unless user.try(:authenticate, session_params[:password])
|
||||
logger.info "Support: #{session_params[:email]} login failed."
|
||||
return redirect_to(signin_path, alert: I18n.t("invalid_credentials"))
|
||||
end
|
||||
|
||||
# Check that the user is not deleted
|
||||
return redirect_to root_path, flash: { alert: I18n.t("registration.banned.fail") } if user.deleted?
|
||||
|
||||
|
Reference in New Issue
Block a user