forked from External/greenlight
master #1
|
@ -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?
|
||||
|
||||
|
|
|
@ -238,7 +238,7 @@ class User < ApplicationRecord
|
|||
def check_domain
|
||||
if Rails.configuration.require_email_domain.any? && !email.end_with?(*Rails.configuration.require_email_domain)
|
||||
errors.add(:email, I18n.t("errors.messages.domain",
|
||||
email_domain: Rails.configuration.require_email_domain.join('" ' + I18n.t("modal.login.or") + ' "')))
|
||||
email_domain: Rails.configuration.require_email_domain.join("\" #{I18n.t('modal.login.or')} \"")))
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue