Expire the previous JWT on update if HTTP root is set

* Required for Tautulli/Tautulli-Issues#255
This commit is contained in:
JonnyWong16
2020-06-24 14:04:07 -07:00
parent ff887d9948
commit 48f846da40
3 changed files with 13 additions and 3 deletions

View File

@@ -296,10 +296,14 @@ class AuthController(object):
self.on_logout(payload['user'], payload['user_group'])
jwt_cookie = str(JWT_COOKIE_NAME + plexpy.CONFIG.PMS_UUID)
cherrypy.response.cookie[jwt_cookie] = 'expire'
cherrypy.response.cookie[jwt_cookie] = ''
cherrypy.response.cookie[jwt_cookie]['expires'] = 0
cherrypy.response.cookie[jwt_cookie]['path'] = plexpy.HTTP_ROOT.rstrip('/') or '/'
if plexpy.HTTP_ROOT != '/':
# Aslo expire the JWT on the root path
cherrypy.response.headers['Set-Cookie'] = jwt_cookie + '=""; expires=Thu, 01 Jan 1970 12:00:00 GMT; path=/'
cherrypy.request.login = None
if redirect_uri: