def complete
      if params[:cancel]
        cancel
      else
        resp = checkid_request.answer(true, nil, identifier(current_account))
        if params[:always]
          @site = current_account.sites.find_or_create_by_persona_id_and_url(params[:site][:persona_id], params[:site][:url])
          @site.update_attributes(params[:site])
        elsif sreg_request || ax_fetch_request
          @site = current_account.sites.find_or_initialize_by_persona_id_and_url(params[:site][:persona_id], params[:site][:url])
          @site.attributes = params[:site]
        elsif ax_store_request
          @site = current_account.sites.find_or_initialize_by_persona_id_and_url(params[:site][:persona_id], params[:site][:url])
          not_supported, not_accepted, accepted = [], [], []
          ax_store_request.data.each do |type_uri, values|
            if property = Persona.attribute_name_for_type_uri(type_uri)
              store_attribute = params[:site][:ax_store][property.to_sym]
              if store_attribute && !store_attribute[:value].blank?
                @site.persona.update_attribute(property, values.first)
                accepted << type_uri
              else
                not_accepted << type_uri
              end
            else
              not_supported << type_uri
            end
          end
          ax_store_response = (accepted.count > 0) ? OpenID::AX::StoreResponse.new : OpenID::AX::StoreResponse.new(false, "None of the attributes were accepted.")
          resp.add_extension(ax_store_response)
        end
        resp = add_pape(resp, auth_policies, auth_level, auth_time)
        resp = add_sreg(resp, @site.sreg_properties) if sreg_request && @site.sreg_properties
        resp = add_ax(resp, @site.ax_properties) if ax_fetch_request && @site.ax_properties
        render_response(resp)
      end
    end
def complete
      if params[:cancel]
        cancel
      else
        resp = checkid_request.answer(true, nil, identifier(current_account))
        if params[:always]
          @site = current_account.sites.find_or_create_by_persona_id_and_url(params[:site][:persona_id], params[:site][:url])
          @site.update_attributes(params[:site])
        elsif sreg_request || ax_fetch_request
          @site = current_account.sites.find_or_initialize_by_persona_id_and_url(params[:site][:persona_id], params[:site][:url])
          @site.attributes = params[:site]
        elsif ax_store_request
          @site = current_account.sites.find_or_initialize_by_persona_id_and_url(params[:site][:persona_id], params[:site][:url])
          not_supported, not_accepted, accepted = [], [], []
          ax_store_request.data.each do |type_uri, values|
            if property = Persona.attribute_name_for_type_uri(type_uri)
              store_attribute = params[:site][:ax_store][property.to_sym]
              if store_attribute && !store_attribute[:value].blank?
                @site.persona.update_attribute(property, values.first)
                accepted << type_uri
              else
                not_accepted << type_uri
              end
            else
              not_supported << type_uri
            end
          end
          ax_store_response = (accepted.count > 0) ? OpenID::AX::StoreResponse.new : OpenID::AX::StoreResponse.new(false, "None of the attributes were accepted.")
          resp.add_extension(ax_store_response)
        end
        resp = add_pape(resp, auth_policies, auth_level, auth_time)
        resp = add_sreg(resp, @site.sreg_properties) if sreg_request && @site.sreg_properties
        resp = add_ax(resp, @site.ax_properties) if ax_fetch_request && @site.ax_properties
        render_response(resp)
      end
    end
This action is called by submitting the decision form, the information entered by
 the user is used to answer the request. If the user decides to always trust the
 relying party, a new site according to the release policies the will be created.