Commit 318a148d authored by Saito's avatar Saito
Browse files

fix a npe, and need a patch for path_info

parent 585d91dcf1cd
......@@ -5,7 +5,10 @@
# Authentication with username and password
email, password = @auth.credentials
user = User.find_by_email(email)
return false unless user.valid_password?(password)
return false unless user.try(:valid_password?, password)
# Need this patch because the rails mount
@env['PATH_INFO'] = @env['REQUEST_PATH']
# Find project by PATH_INFO from env
if m = /^\/([\w-]+).git/.match(@env['PATH_INFO']).to_a
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment