app/controllers/application_controller.rb
# login to the portal provided in the parameters
login to the portal provided in the parameters
login to the portal provided in the parameters
def portal_login
    if params[:domain]
      sign_out(current_user) unless has_matching_domain_uid(params[:domain],params[:domain_uid])
      uri = URI(request.original_url)
      query_params = request.query_parameters
      query_params.delete(:domain)
      query_params.delete(:domain_uid)
      uri.query = URI.encode_www_form(query_params)
      strategy_name = Concord::AuthPortal.strategy_name_for_url(params[:domain])
      redirect_to user_omniauth_authorize_path(strategy_name, :origin => uri.to_s)
    end
  end
def portal_login if params [ :domain ] sign_out ( current_user ) unless has_matching_domain_uid ( params [ :domain ] , params [ :domain_uid ] ) uri = URI ( request . original_url ) query_params = request . query_parameters query_params . delete ( :domain ) query_params . delete ( :domain_uid ) uri . query = URI . encode_www_form ( query_params ) strategy_name = Concord :: AuthPortal . strategy_name_for_url ( params [ :domain ] ) redirect_to user_omniauth_authorize_path ( strategy_name , :origin => uri . to_s ) end end
login to the portal provided in the parameters
login to the portal provided in the parameters
# Remove domain from original url to avoid infinite loop. # we set the origin here which will become request.env['omniauth.origin'] # in the callback phase, by default omniauth will use use # the referer and that is not changed during redirects. More info: # https://github.com/intridea/omniauth/wiki/Saving-User-Location