Wrong redirect after login with relative url root
Created by: simonswine
Hallo,
I recently noticed a bug during login. If I login successfully after an a failed login attempt, I get redirected to the wrong url. This url contains the relative_url_root twice. If i enter my login credentials right in the first place everything is as it's expected to be.
- case 1: Successful login after failed one
- case 2: Successful login in the first place
My Gitlab setup uses:
- Gitlab 7-4-stable branch
- Ruby 2.0
- relative_url_root = /gitlab
- gitlab:check / gitlab:info shows no errors
What i've done so far:
- compared the HTML DOM and the HTTP request of the successfull attempts for each case: they're identical.
- checked the log files output:
# case 1
Started POST "/gitlab/users/sign_in" for 127.0.0.1 at 2014-11-03 13:57:41 +0100
Processing by SessionsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"YY", "user"=>{"login"=>"user", "password"=>"[FILTERED]", "remember_me"=>"0"}}
Redirected to https://domain/gitlab/gitlab/users/sign_in
# case 2
Started POST "/gitlab/users/sign_in" for 127.0.0.1 at 2014-11-03 13:57:06 +0100
Processing by SessionsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"YY", "user"=>{"login"=>"user", "password"=>"[FILTERED]", "remember_me"=>"0"}}
Redirected to https://domain/gitlab/users/sign_in
As we can see in the logs there is a wrong redirect for case 1 coming from the server side. I looked a bit into gitlab's code, but I'm not very familiar with the devise gem. Maybe someone can give me a hint were to look deeper into it.
Thanks, simonswine