arr2036 / omnigollum

Omniauth authentication for gollum
MIT License
147 stars 61 forks source link

The omniauth.origin is nil in rack production environment? #35

Open njman opened 9 years ago

njman commented 9 years ago

I launched the gollum&omnigollum&omniauth-ldap via unicorn way: unicorn -c unicorn.rb -E production. Test the login failure scenario.

And found omniauth.origin is nil:

      app.before options[:route_prefix] + '/auth/failure' do
        user_deauth
        @title    = 'Authentication failed'
        @subtext = "Provider did not validate your credentials (#{params[:message]}) - please retry or choose another login service"
        @auth_params = "?origin=#{CGI.escape(request.env['omniauth.origin'])}" unless request.env['omniauth.origin'].nil?
        if request.env['omniauth.origin'].nil?
         puts 'Noop, why omniauth.origin is nil??'
        end
        puts "auth failure #{@auth_params}"
        show_error
      end

Which led loginurl be set incorrect.

However, the omniauth.origin was set right in front web page if rack was in development environment.

How to handle this problem? thanks.