9
This commit is contained in:
@@ -24,11 +24,7 @@ def token_required(f):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
data = jwt.decode(token, SECRET_KEY, algorithms=["HS256"])
|
data = jwt.decode(token, SECRET_KEY, algorithms=["HS256"])
|
||||||
user_info = {
|
user_info = data['user_id'] # передаём просто user_id (int)
|
||||||
'user_id': data['user_id'],
|
|
||||||
'company_id': data['company_id'],
|
|
||||||
'role': data['role']
|
|
||||||
}
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return jsonify({'message': 'Token is invalid or expired!'}), 401
|
return jsonify({'message': 'Token is invalid or expired!'}), 401
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user