X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/d4130bcac83015564f0326457f2bb67d1b5ebab6..2d3972249c18fc5cd193a8b2f2efe9b46badb217:/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 ##