GitLab steht aufgrund wichtiger Wartungsarbeiten am Montag, den 8. März, zwischen 17:00 und 19:00 Uhr nicht zur Verfügung.

Commit 0c5a438a authored by jplang's avatar jplang

Fixed that autologin cookie is not deleted when using custom cookie name (#13335).

git-svn-id: https://svn.redmine.org/redmine/trunk@11520 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 2f550a3d
......@@ -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
......
Markdown is supported
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