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:
Sam
2018-03-06 16:49:31 +11:00
parent f0d5f83424
commit 0134e41286
9 changed files with 82 additions and 11 deletions

View File

@ -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"