From 033a397a4349cadd4bb7319a667e95702e76949d Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sun, 8 Dec 2024 22:32:08 -0500 Subject: [PATCH] app.config['SECRET_KEY'] --- services/web/project/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/web/project/__init__.py b/services/web/project/__init__.py index f78bf76..88bbf93 100644 --- a/services/web/project/__init__.py +++ b/services/web/project/__init__.py @@ -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