Passing parameters thru Ruby's OAuth

Posted by JP on Stack Overflow See other posts from Stack Overflow or by JP
Published on 2010-04-15T17:40:20Z Indexed on 2010/04/15 17:43 UTC
Read the original article Hit count: 321

Filed under:
|
|

I'm using Mirven's Twitter OAuth Sinatra example and trying to figure out how I can send a 'next page' parameter with the Oauth request:

ie. The user attempts to visit /edit/profile which requires a login so I redirect to /request which deals with login via twitter - I now want to be able to redirect the user to the address they were originally looking for if they log in successfully.

I thought I could do this in the .get_request_token line with this code:

  @request_token = @consumer.get_request_token({:oauth_callback => "http://#{request.host}/auth"},{:next => params['next'] || '/'})

But params has no additional items in the /auth handler.

I'm new to OAuth, how would I go about doing this?

© Stack Overflow or respective owner

Related posts about ruby

Related posts about sinatra