Commit aefe4dc3a2668ec12782f7ac1a245effb60b9339

Authored by Saito
1 parent 7888e3ae

fix a npe, and need a patch for path_info

Showing 1 changed file with 4 additions and 1 deletions   Show diff stats
config/initializers/grack_auth.rb
... ... @@ -5,7 +5,10 @@ module Grack
5 5 # Authentication with username and password
6 6 email, password = @auth.credentials
7 7 user = User.find_by_email(email)
8   - return false unless user.valid_password?(password)
  8 + return false unless user.try(:valid_password?, password)
  9 +
  10 + # Need this patch because the rails mount
  11 + @env['PATH_INFO'] = @env['REQUEST_PATH']
9 12  
10 13 # Find project by PATH_INFO from env
11 14 if m = /^\/([\w-]+).git/.match(@env['PATH_INFO']).to_a
... ...