Skip to content

Instantly share code, notes, and snippets.

@paul
Created November 21, 2008 22:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paul/27674 to your computer and use it in GitHub Desktop.
Save paul/27674 to your computer and use it in GitHub Desktop.
diff --git a/merb-auth/merb-auth-core/lib/merb-auth-core/authenticated_helper.rb b/merb-auth/merb-auth-core/lib/merb-auth-core/authenticated_helper.rb
index 24a39d4..b649d94 100644
--- a/merb-auth/merb-auth-core/lib/merb-auth-core/authenticated_helper.rb
+++ b/merb-auth/merb-auth-core/lib/merb-auth-core/authenticated_helper.rb
@@ -31,8 +31,8 @@ module Merb
def ensure_authenticated(*strategies)
session.authenticate!(request, params, *strategies) unless session.authenticated?
auth = session.authentication
+ self.headers.merge!(auth.headers)
if auth.halted?
- self.headers.merge!(auth.headers)
self.status = auth.status
throw :halt, auth.body
end
diff --git a/merb-auth/merb-auth-core/lib/merb-auth-core/authentication.rb b/merb-auth/merb-auth-core/lib/merb-auth-core/authentication.rb
index ec15cd0..3e19fbe 100644
--- a/merb-auth/merb-auth-core/lib/merb-auth-core/authentication.rb
+++ b/merb-auth/merb-auth-core/lib/merb-auth-core/authentication.rb
@@ -91,6 +91,7 @@ module Merb
unless s.abstract?
strategy = s.new(request, params)
user = strategy.run!
+ self.headers.merge!(strategy.headers)
if strategy.halted?
self.headers, self.status, self.body = [strategy.headers, strategy.status, strategy.body]
halt!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment