]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/oauth_controller.rb
Merge branch 'master' into moderation
[rails.git] / app / controllers / oauth_controller.rb
index 2e847fcd5915e9b954c85ae5c87774a55e87e0ff..734783a35eef61f4df429abfee6b1aa2fd9facf8 100644 (file)
@@ -38,6 +38,8 @@ class OauthController < ApplicationController
   protected
 
   def oauth1_authorize
+    append_content_security_policy_directives(:form_action => %w[*])
+
     if @token.invalidated?
       @message = t "oauth.oauthorize_failure.invalid"
       render :action => "authorize_failure"
@@ -49,7 +51,7 @@ class OauthController < ApplicationController
                        else
                          @token.oob? ? @token.client_application.callback_url : @token.callback_url
                        end
-        @redirect_url = URI.parse(callback_url) unless callback_url.blank?
+        @redirect_url = URI.parse(callback_url) if callback_url.present?
 
         if @redirect_url.to_s.blank?
           render :action => "authorize_success"