Commit aefe4dc3a2668ec12782f7ac1a245effb60b9339
1 parent
7888e3ae
Exists in
master
and in
4 other branches
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,7 +5,10 @@ module Grack | ||
5 | # Authentication with username and password | 5 | # Authentication with username and password |
6 | email, password = @auth.credentials | 6 | email, password = @auth.credentials |
7 | user = User.find_by_email(email) | 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 | # Find project by PATH_INFO from env | 13 | # Find project by PATH_INFO from env |
11 | if m = /^\/([\w-]+).git/.match(@env['PATH_INFO']).to_a | 14 | if m = /^\/([\w-]+).git/.match(@env['PATH_INFO']).to_a |