lib/ballast/concerns/common.rb in ballast-2.2.3 vs lib/ballast/concerns/common.rb in ballast-2.2.4

- old
+ new

@@ -83,10 +83,10 @@ # @param area [String|NilClass] The name of the area. # @param title [String|NilClass] A title for authentication errors. # @param message [String|NilClass] A message for authentication errors. # @param authenticator [Proc] A block to verify if authentication is valid. def authenticate_user(area: nil, title: nil, message: nil, &authenticator) - return if authenticate_with_http_basic { |username, password| authenticator.call(username, password) } + return if authenticate_with_http_basic(&authenticator) area ||= "Private Area" title ||= "Authentication required." message ||= "To view this resource you have to authenticate."