views:

139

answers:

1

I'm trying to combine Ryan Bates' Beta invitations and Open id. The way it is setup is so that signup form has hidden field, invitation token that allows user to sign up. The invitation token is sent in url: /signup/:invitation_token

However when I use open_id, it redirects back to just /signup url without the invitation token. How do I have it so that the token is still being pass after the redirect. Here's the relevant code in open_id_authorization plugin

def open_id_redirect_url(open_id_request, return_to = nil, method = nil)
  open_id_request.return_to_args['_method'] = (method || request.method).to_s
  open_id_request.return_to_args['open_id_complete'] = '1'
  open_id_request.redirect_url(root_url, return_to || requested_url)
end

def requested_url
  relative_url_root = self.class.respond_to?(:relative_url_root) ?
    self.class.relative_url_root.to_s :
    request.relative_url_root
  "#{request.protocol}#{request.host_with_port}#{ActionController::Base.relative_url_root}#{request.path}"
end

Thanks.

A: 

I think you need to tell the open_id plugin to return to /signup/:invitation_token instead of just /signup:

signup_url(:invitation_token => params[:invitation_token])

Pass that to open_id_redirect_url. I'm not 100% sure this is your problem, though.

Jonathan Julian