]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/application_controller.rb
Add javascript OAuth support
[rails.git] / app / controllers / application_controller.rb
index 4b2c7082558c22eee5fe0ad4c8532c210744db89..4ac3297c6d532237a05f405bbd71b1e473e2dd5f 100644 (file)
@@ -55,6 +55,10 @@ class ApplicationController < ActionController::Base
     end
   end
 
     end
   end
 
+  def require_oauth
+    @oauth = @user.access_token(OAUTH_KEY) if @user and defined? OAUTH_KEY
+  end
+
   ##
   # requires the user to be logged in by the token or HTTP methods, or have an 
   # OAuth token with the right capability. this method is a bit of a pain to call 
   ##
   # requires the user to be logged in by the token or HTTP methods, or have an 
   # OAuth token with the right capability. this method is a bit of a pain to call