mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 06:56:01 +08:00
FIX: Improve token rotation and increase logging
- avoid access denied on bad cookie, instead just nuke it - avoid marking a token unseen for first minute post rotation - log path in user auth token logs
This commit is contained in:
@ -208,15 +208,7 @@ describe Auth::DefaultCurrentUserProvider do
|
||||
end
|
||||
|
||||
it "correctly removes invalid cookies" do
|
||||
|
||||
cookies = {"_t" => SecureRandom.hex}
|
||||
|
||||
(Auth::DefaultCurrentUserProvider::MAX_COOKIE_MISSES).times do
|
||||
provider('/').refresh_session(nil, {}, cookies)
|
||||
end
|
||||
|
||||
expect(cookies.key?("_t")).to eq(true)
|
||||
|
||||
provider('/').refresh_session(nil, {}, cookies)
|
||||
expect(cookies.key?("_t")).to eq(false)
|
||||
end
|
||||
|
Reference in New Issue
Block a user