mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 06:56:01 +08:00
FIX: allow some auth token misses prior to clearing cookie
It appears that in some cases ios queues up requests up front and "releases" them when tab gets focus, this allows for a certain number of cookie misses for this case. Otherwise you get logged off.
This commit is contained in:
@ -201,9 +201,15 @@ describe Auth::DefaultCurrentUserProvider do
|
||||
|
||||
it "correctly removes invalid cookies" do
|
||||
|
||||
cookies = {"_t" => "BAAAD"}
|
||||
provider('/').refresh_session(nil, {}, cookies)
|
||||
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