Fixed that autologin cookie is not deleted when using custom cookie name (#13335).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11520 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
08ef201cec
commit
a010372458
|
@ -157,7 +157,7 @@ class ApplicationController < ActionController::Base
|
|||
# Logs out current user
|
||||
def logout_user
|
||||
if User.current.logged?
|
||||
cookies.delete :autologin
|
||||
cookies.delete(autologin_cookie_name)
|
||||
Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin'])
|
||||
self.logged_user = nil
|
||||
end
|
||||
|
|
|
@ -87,6 +87,11 @@ class AccountTest < ActionController::IntegrationTest
|
|||
cookies['custom_autologin'] = token
|
||||
get '/my/page'
|
||||
assert_response :success
|
||||
|
||||
assert_difference 'Token.count', -1 do
|
||||
post '/logout'
|
||||
end
|
||||
assert cookies['custom_autologin'].blank?
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue