14 lines
301 B
Python
14 lines
301 B
Python
|
from jose import JWTError, jwt
|
||
|
import os
|
||
|
import werkzeug
|
||
|
|
||
|
|
||
|
JWT_SECRET = os.environ['JWT_SECRET']
|
||
|
|
||
|
def decodeToken(token):
|
||
|
try:
|
||
|
return jwt.decode(token, JWT_SECRET)
|
||
|
except JWTError as e:
|
||
|
print("ERROR: decodeToken: {}".format(e))
|
||
|
raise werkzeug.exceptions.Unauthorized()
|