Skip to content

Commit

Permalink
Add a note about hacking with URL params instead of cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
courtenay committed Jan 25, 2009
1 parent e6b3a04 commit 6d389fb
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,28 @@ class SessionsController
end
end

If you want to have Tender redirect to your site's login form and can't/don't want to use domain cookies you
can just pass the variables in the URL.

Tender -> click "login" -> goes to your site -> returns to Tender with URL params

You can implement this something like

# /app/controllers/sessions_controller.rb
class SessionsController
def login
if user = User.authenticate(params[:login], params[:password])
if params[:tender]
auth = user.tender_multipass({}, 1.week.from_now.to_i)
redirect_to "http://your.tenderapp.com/login?email=#{auth[:tender_email]}&expires=#{auth[:tender_expires]}&hash=#{auth[:tender_hash]}"
else
redirect_to "/"
end
end
end
end


Notes
=====

Expand Down

0 comments on commit 6d389fb

Please sign in to comment.