diff --git a/plexpy/webauth.py b/plexpy/webauth.py index 312bb07a..ac5decd2 100644 --- a/plexpy/webauth.py +++ b/plexpy/webauth.py @@ -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)