]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/sessions_controller.rb
Don't try and write directly to the user status
[rails.git] / app / controllers / sessions_controller.rb
index bb3854e69b3d48348c394faa8dbc4ec6b2b2ac48..9489553a81d438abfcc4620d8e8452cebfaa6d76 100644 (file)
@@ -12,9 +12,7 @@ class SessionsController < ApplicationController
   authorize_resource :class => false
 
   def new
-    append_content_security_policy_directives(
-      :form_action => %w[*]
-    )
+    override_content_security_policy_directives(:form_action => []) if Settings.csp_enforce || Settings.key?(:csp_report_url)
 
     session[:referer] = safe_referer(params[:referer]) if params[:referer]
   end
@@ -40,11 +38,7 @@ class SessionsController < ApplicationController
 
       referer = safe_referer(params[:referer]) if params[:referer]
 
-      if referer
-        redirect_to referer
-      else
-        redirect_to :controller => "site", :action => "index"
-      end
+      redirect_to referer || { :controller => "site", :action => "index" }
     end
   end