mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-04-07 14:06:11 +08:00
Python: linux support (bug with json jwt decoding)
This commit is contained in:
@ -26,6 +26,7 @@
|
||||
|
||||
import config
|
||||
import jwt
|
||||
import platform
|
||||
|
||||
# check if a secret key to generate token exists or not
|
||||
def isEnabled():
|
||||
@ -33,7 +34,10 @@ def isEnabled():
|
||||
|
||||
# encode a payload object into a token using a secret key and decodes it into the utf-8 format
|
||||
def encode(payload):
|
||||
return jwt.encode(payload, config.DOC_SERV_JWT_SECRET, algorithm='HS256').decode('utf-8')
|
||||
jwtEncode = jwt.encode(payload, config.DOC_SERV_JWT_SECRET, algorithm='HS256')
|
||||
|
||||
if platform.system() != "Linux": return jwtEncode.decode('utf-8')
|
||||
return jwtEncode
|
||||
|
||||
# decode a token into a payload object using a secret key
|
||||
def decode(string):
|
||||
|
||||
Reference in New Issue
Block a user