Decode jwt_token for login cookie
This commit is contained in:
@@ -332,7 +332,7 @@ class AuthController(object):
|
|||||||
'exp': expiry
|
'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'],
|
self.on_login(username=user_details['username'],
|
||||||
user_id=user_details['user_id'],
|
user_id=user_details['user_id'],
|
||||||
@@ -347,7 +347,7 @@ class AuthController(object):
|
|||||||
|
|
||||||
cherrypy.request.login = payload
|
cherrypy.request.login = payload
|
||||||
cherrypy.response.status = 200
|
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:
|
elif admin_login == '1' and username:
|
||||||
self.on_login(username=username)
|
self.on_login(username=username)
|
||||||
|
Reference in New Issue
Block a user