Decode jwt_token for login cookie

This commit is contained in:
JonnyWong16 2019-11-24 15:50:27 -08:00
commit 077dfe7164

View file

@ -332,7 +332,7 @@ class AuthController(object):
'exp': expiry
}
jwt_token = jwt.encode(payload, plexpy.CONFIG.JWT_SECRET, algorithm=JWT_ALGORITHM)
jwt_token = jwt.encode(payload, plexpy.CONFIG.JWT_SECRET, algorithm=JWT_ALGORITHM).decode('utf-8')
self.on_login(username=user_details['username'],
user_id=user_details['user_id'],
@ -347,7 +347,7 @@ class AuthController(object):
cherrypy.request.login = payload
cherrypy.response.status = 200
return {'status': 'success', 'token': jwt_token.decode('utf-8'), 'uuid': plexpy.CONFIG.PMS_UUID}
return {'status': 'success', 'token': jwt_token, 'uuid': plexpy.CONFIG.PMS_UUID}
elif admin_login == '1' and username:
self.on_login(username=username)