Skip to content

Commit

Permalink
prevent addition of ? marks to callback url when not needed
Browse files Browse the repository at this point in the history
Conflicts:

	lib/oauth/controllers/consumer_controller.rb
  • Loading branch information
kookster authored and pelle committed Apr 3, 2012
1 parent 851ec16 commit 00b7892
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/oauth/controllers/consumer_controller.rb
Expand Up @@ -25,10 +25,10 @@ def show

unless @token
if @consumer.ancestors.include?(Oauth2Token)
request_url = callback2_oauth_consumer_url(params[:id]) + '?' + request.query_string
request_url = callback2_oauth_consumer_url(params[:id]) + callback2_querystring
redirect_to @consumer.authorize_url(request_url)
else
request_url = callback_oauth_consumer_url(params[:id]) + '?' + request.query_string
request_url = callback_oauth_consumer_url(params[:id]) + callback2_querystring
@request_token = @consumer.get_request_token(request_url)
session[@request_token.token]=@request_token.secret
if @request_token.callback_confirmed?
Expand All @@ -39,7 +39,11 @@ def show
end
end
end


def callback2_querystring
request.query_string.blank? ? '' : '?' + request.query_string
end

def callback2
@token = @consumer.access_token(current_user,params[:code], callback2_oauth_consumer_url(params[:id]))
logger.info @token.inspect
Expand Down

0 comments on commit 00b7892

Please sign in to comment.