Skip to content

Commit

Permalink
fix to work with sign in w/twitter so it won't continually ask the us…
Browse files Browse the repository at this point in the history
…er to authorize the site
  • Loading branch information
BrianTheCoder committed Feb 15, 2010
1 parent 55e2da9 commit c0c6f20
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/rack-oauth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ def callback_path
attr_accessor :consumer_site
alias site consumer_site
alias site= consumer_site=

# for using "Sign in w/twitter"
attr_accessor :authentication

# an arbitrary name for this instance of Rack::OAuth
def name
Expand Down Expand Up @@ -204,7 +207,9 @@ def do_login env
session(env)[:secret] = request.secret

# redirect to the oauth provider's authorize url to authorize the user
[ 302, { 'Content-Type' => 'text/html', 'Location' => request.authorize_url }, [] ]
path = request.authorize_url
path.gsub!('authorize', 'authenticate') if @authentication
[ 302, { 'Content-Type' => 'text/html', 'Location' => path }, [] ]
end

def do_callback env
Expand Down

0 comments on commit c0c6f20

Please sign in to comment.