diff --git a/app/models/authentication.rb b/app/models/authentication.rb index 096f40a45b5f..36604c161b29 100644 --- a/app/models/authentication.rb +++ b/app/models/authentication.rb @@ -92,7 +92,7 @@ def validation_successful def validation_failed(status = :unreachable, message = nil) message ||= ERRORS[status] _log.warn("[#{resource_type}] [#{resource_id}], previously valid on: #{last_valid_on}, previous status: [#{self.status}]") - update_attributes(:status => status.to_s.capitalize, :status_details => message.to_s, :last_invalid_on => Time.now.utc) + update_attributes(:status => status.to_s.capitalize, :status_details => message.to_s.truncate(200), :last_invalid_on => Time.now.utc) raise_event(status, message) end diff --git a/app/models/mixins/authentication_mixin.rb b/app/models/mixins/authentication_mixin.rb index 15a2594ec9a4..827917543aae 100644 --- a/app/models/mixins/authentication_mixin.rb +++ b/app/models/mixins/authentication_mixin.rb @@ -334,7 +334,7 @@ def authentication_check(*args) status == :valid ? auth.validation_successful : auth.validation_failed(status, details) end - return status == :valid, details + return status == :valid, details.truncate(20000) end def default_authentication @@ -360,9 +360,9 @@ def authentication_check_no_validation(type, options) end end - details &&= details.to_s.truncate(200) + details &&= details.to_s - _log.warn("#{header} Validation failed: #{status}, #{details}") unless status == :valid + _log.warn("#{header} Validation failed: #{status}, #{details.truncate(200)}") unless status == :valid return status, details end