aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
authorLuc Donnet2015-01-29 16:10:43 +0100
committerLuc Donnet2015-01-29 16:10:43 +0100
commit0bf25cd563d38da17c9265570a98bff210044424 (patch)
treef2d6ce72083375461aa96025cc10f181810bc6c0 /app/controllers/application_controller.rb
parent0ee28dc54b2beeada5d86648c5897e2ea6f25c7e (diff)
downloadchouette-core-0bf25cd563d38da17c9265570a98bff210044424.tar.bz2
Fix several problems with devise and use mainstream source now
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 4359ee02e..63775a30f 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -1,7 +1,10 @@
class ApplicationController < ActionController::Base
- protect_from_forgery
+ # TODO : Delete hack to authorize Cross Request for js and json get request from javascript
+ protect_from_forgery unless: -> { request.get? && (request.format.json? || request.format.js?) }
before_filter :authenticate_user!
before_filter :set_locale
+
+ # Load helpers in rails engine
helper LanguageEngine::Engine.helpers
def set_locale