feat: implement backend core with repricing logic, case management, and multi-service architecture
This commit is contained in:
@@ -24,9 +24,13 @@ def token_required(f):
|
||||
|
||||
try:
|
||||
data = jwt.decode(token, SECRET_KEY, algorithms=["HS256"])
|
||||
current_user_id = data['user_id']
|
||||
user_info = {
|
||||
'user_id': data['user_id'],
|
||||
'company_id': data['company_id'],
|
||||
'role': data['role']
|
||||
}
|
||||
except Exception as e:
|
||||
return jsonify({'message': 'Token is invalid or expired!'}), 401
|
||||
|
||||
return f(current_user_id, *args, **kwargs)
|
||||
return f(user_info, *args, **kwargs)
|
||||
return decorated
|
||||
|
||||
Reference in New Issue
Block a user