app.config['SECRET_KEY']

This commit is contained in:
CHIEFSOFT\ameye
2024-12-08 22:32:08 -05:00
parent 94cb92ef19
commit 033a397a43
+3 -2
View File
@@ -36,11 +36,12 @@ def token_required(f):
#token = request.args.get('token')
token = request.headers["Authorization"].split(" ")[1]
print(token)
if not token:
return jsonify({'message': 'Error - missing token'}), 403
try:
data = jwt.decode(token, app.config['SECRET_KEY'], algorithm="HS256")
#data = jwt.decode(token, app.config['SECRET_KEY'], algorithm="HS256")
data= jwt.decode(token, app.config['SECRET_KEY'], algorithms=["HS256"])
except:
return jsonify({'message': 'Token is invalid'}),403