From d75bc6ef690c3c42daedc78342167306eccf38af Mon Sep 17 00:00:00 2001 From: Matt Amos Date: Tue, 4 Aug 2009 12:59:02 +0000 Subject: [PATCH] Use method rather than direct access to member for the current token. --- app/controllers/application_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 110682947..d9bc9e4f1 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -31,8 +31,8 @@ class ApplicationController < ActionController::Base def require_capability(cap) # when the current token is nil, it means the user logged in with a different # method, otherwise an OAuth token was used, which has to be checked. - unless @current_token.nil? - unless @current_token.read_attribute(cap) + unless current_token.nil? + unless current_token.read_attribute(cap) render :text => "OAuth token doesn't have that capability.", :status => :forbidden return false end @@ -66,7 +66,7 @@ class ApplicationController < ActionController::Base def setup_user_auth # try and setup using OAuth if oauthenticate - @user = @current_token.user + @user = current_token.user else username, passwd = get_auth_data # parse from headers # authenticate per-scheme -- 2.43.2