mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
FEATURE: detect when client thinks user is logged on but is not
This cleans up an error condition where UI thinks a user is logged on but the user is not. If this happens user will be prompted to refresh.
This commit is contained in:
@ -78,6 +78,10 @@ module Hijack
|
||||
headers['Content-Length'] = body.bytesize
|
||||
headers['Connection'] = "close"
|
||||
|
||||
if env[Auth::DefaultCurrentUserProvider::BAD_TOKEN]
|
||||
headers['Discourse-Logged-Out'] = '1'
|
||||
end
|
||||
|
||||
status_string = Rack::Utils::HTTP_STATUS_CODES[response.status.to_i] || "Unknown"
|
||||
io.write "#{response.status} #{status_string}\r\n"
|
||||
|
||||
|
Reference in New Issue
Block a user