X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/a792b74bea261834791e9f75c64161436d37053f..c24c2e481cc6d27e76274ed4e32668a4690a7788:/app/controllers/application_controller.rb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 616223a06..f1e847e10 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -3,6 +3,8 @@ class ApplicationController < ActionController::Base protect_from_forgery :with => :exception + add_flash_types :warning, :error + rescue_from CanCan::AccessDenied, :with => :deny_access check_authorization @@ -10,8 +12,10 @@ class ApplicationController < ActionController::Base around_action :better_errors_allow_inline, :if => proc { Rails.env.development? } attr_accessor :current_user + attr_accessor :oauth_token helper_method :current_user + helper_method :oauth_token helper_method :preferred_langauges private @@ -56,7 +60,7 @@ class ApplicationController < ActionController::Base end def require_oauth - @oauth = current_user.access_token(Settings.oauth_key) if current_user && Settings.key?(:oauth_key) + @oauth_token = current_user.access_token(Settings.oauth_key) if current_user && Settings.key?(:oauth_key) end ##