]> git.openstreetmap.org Git - rails.git/blobdiff - config/initializers/omniauth.rb
Avoid relying on the order in which emails are sent
[rails.git] / config / initializers / omniauth.rb
index 2f2245419dd711a9d681057af47afb9d30daef4e..a6fe67e1792022a7583ce6aa80ae6d09c3bb0ab3 100644 (file)
@@ -14,3 +14,16 @@ end
 Rails.application.config.middleware.use OmniAuth::Builder do
   provider :openid, :name => "openid", :store => openid_store
 end
 Rails.application.config.middleware.use OmniAuth::Builder do
   provider :openid, :name => "openid", :store => openid_store
 end
+
+# Pending fix for: https://github.com/intridea/omniauth/pull/795
+module OmniAuth
+  module Strategy
+    def mock_callback_call_with_origin
+      @env["omniauth.origin"] = session["omniauth.origin"]
+
+      mock_callback_call_without_origin
+    end
+
+    alias_method_chain :mock_callback_call, :origin
+  end
+end