Update oauth models and controllers for OAuth 1.0a support
This commit is contained in:
parent
c08f9a2f03
commit
1c3a9ee62b
5 changed files with 67 additions and 8 deletions
|
@ -52,9 +52,17 @@ class OauthController < ApplicationController
|
|||
|
||||
if any_auth
|
||||
@token.authorize!(@user)
|
||||
redirect_url = params[:oauth_callback] || @token.client_application.callback_url
|
||||
if @token.oauth10?
|
||||
redirect_url = params[:oauth_callback] || @token.client_application.callback_url
|
||||
else
|
||||
redirect_url = @token.oob? ? @token.client_application.callback_url : @token.callback_url
|
||||
end
|
||||
if redirect_url
|
||||
redirect_to "#{redirect_url}?oauth_token=#{@token.token}"
|
||||
if @token.oauth10?
|
||||
redirect_to "#{redirect_url}?oauth_token=#{@token.token}"
|
||||
else
|
||||
redirect_to "#{redirect_url}?oauth_token=#{@token.token}&oauth_verifier=#{@token.verifier}"
|
||||
end
|
||||
else
|
||||
render :action => "authorize_success"
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue