omnigollum icon indicating copy to clipboard operation
omnigollum copied to clipboard

The omniauth.origin is nil in rack production environment?

Open njman opened this issue 9 years ago • 0 comments

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.

njman avatar Jun 16 '15 10:06 njman