| |   |
| 34 | 34 | # papereq = ::OpenID::PAPE::Request.new |
| 35 | 35 | # ... |
| 36 | 36 | |
| if openid_request.send_redirect?(options[:realm], options[:return_to]) |
| redirect_to openid_request.redirect_url(options[:realm], options[:return_to]) |
| if openid_request.send_redirect?(options[:realm], open_id_complete_url) |
| redirect_to openid_request.redirect_url(options[:realm], open_id_complete_url) |
| 39 | 39 | else |
| 40 | 40 | #FIXME: create |
| @form_text = openid_request.form_markup(realm, return_to, true, { 'id' => 'openid_form' }) |
| render :layout => nil |
| @form_text = openid_request.form_markup(options[:realm], open_id_complete_url, true, { 'id' => 'openid_form' }) |
| render :partial => 'sessions/openid_form', :layout => nil |
| 43 | 43 | end |
| 44 | 44 | # OpenID login completion |
| 45 | 45 | elsif params[:open_id_complete] |
| 46 | 46 | # Filter path parameters |
| 47 | 47 | parameters = params.reject{ |k,v| request.path_parameters[k] } |
| 48 | 48 | # Complete the OpenID verification process |
| openid_response = openid_consumer.complete(parameters, options[:return_to]) |
| openid_response = openid_consumer.complete(parameters, open_id_complete_url) |
| 50 | 50 | |
| 51 | 51 | case openid_response.status |
| 52 | 52 | when ::OpenID::Consumer::SUCCESS |
| … | … | |
| 56 | 56 | # If already authenticated, add URI to Agent.openid_ownings |
| 57 | 57 | if authenticated? && ! current_agent.openid_uris.include?(uri) |
| 58 | 58 | current_agent.openid_uris << uri |
| flash[:notice] = t(:id_attached_to_account, :id => uri) |
| return current_agent |
| flash[:success] = t('openid.client.id_attached_to_account', :id => uri) |
| |
| if session[:openid_return_to].present? |
| redirect_to session.delete(:openid_return_to) |
| return |
| else |
| return current_agent |
| end |
| 61 | 67 | end |
| 62 | 68 | |
| 63 | 69 | ActiveRecord::Agent.authentication_classes(:openid).each do |klass| |