master #1

Merged
lino.jorzick merged 203 commits from External/greenlight:master into master 2021-10-02 18:19:43 +00:00
2 changed files with 6 additions and 3 deletions
Showing only changes of commit 5872807308 - Show all commits

View File

@ -79,8 +79,11 @@ class SessionsController < ApplicationController
return switch_account_to_local(user) if !is_super_admin && auth_changed_to_local?(user) return switch_account_to_local(user) if !is_super_admin && auth_changed_to_local?(user)
# Check correct password was entered # Check correct password was entered
return redirect_to(signin_path, alert: I18n.t("invalid_credentials")) unless user.try(:authenticate, unless user.try(:authenticate, session_params[:password])
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 # Check that the user is not deleted
return redirect_to root_path, flash: { alert: I18n.t("registration.banned.fail") } if user.deleted? return redirect_to root_path, flash: { alert: I18n.t("registration.banned.fail") } if user.deleted?

View File

@ -238,7 +238,7 @@ class User < ApplicationRecord
def check_domain def check_domain
if Rails.configuration.require_email_domain.any? && !email.end_with?(*Rails.configuration.require_email_domain) if Rails.configuration.require_email_domain.any? && !email.end_with?(*Rails.configuration.require_email_domain)
errors.add(:email, I18n.t("errors.messages.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
end end