]> git.openstreetmap.org Git - rails.git/commitdiff
Allow OAuth 2 authorizations to redirect to anywhere
authorTom Hughes <tom@compton.nu>
Tue, 18 May 2021 11:12:04 +0000 (12:12 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 18 May 2021 11:12:36 +0000 (12:12 +0100)
app/controllers/oauth2_authorizations_controller.rb

index 9c2bce2d1e1cb76a4e87d7b5537933105940e5ca..b851d19b2dd1cd6aea8661bdd8f44d2edd86f8a7 100644 (file)
@@ -5,4 +5,10 @@ class Oauth2AuthorizationsController < Doorkeeper::AuthorizationsController
   before_action :set_locale
 
   authorize_resource :class => false
+
+  def new
+    override_content_security_policy_directives(:form_action => []) if Settings.csp_enforce || Settings.key?(:csp_report_url)
+
+    super
+  end
 end