arr2036 / omnigollum

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

Can't redirect to `/auth/failure` when login failed #34

Closed njman closed 9 years ago

njman commented 9 years ago

I came across the issue with LDAP integration, i.e. can't redirect to /auth/failure when login failed, one exception was thrown out in the front web page. They prompted that:

OmniAuth::Error at /wiki/__omnigollum__/auth/ldap/callback
invalid_credentials
file: failure_endpoint.rb location: raise_out! line: 25

Check the failure_endpoint.rb in omniauth, it hints that:

  # This simple Rack endpoint that serves as the default
  # 'failure' mechanism for OmniAuth. If a strategy fails for
  # any reason this endpoint will be invoked. The default behavior
  # is to redirect to `/auth/failure` except in the case of
  # a development `RACK_ENV`, in which case an exception will
  # be raised.

I launch gollum, omnigollum, omniauth-ldap with Rack way. How can I handle this problem? thanks.

njman commented 9 years ago

In production I should pass -E production, to run the app in the production Rack environment.