Added JWT token process
This commit is contained in:
@@ -88,7 +88,9 @@ def admin_login():
|
||||
}), 401
|
||||
|
||||
token = jwt.encode({
|
||||
'user_id': user.id
|
||||
'user_id': user.id,
|
||||
'is_admin': True,
|
||||
'exp': datetime.utcnow() + timedelta(days=1) # Token expires in 1 day
|
||||
}, current_app.config['SECRET_KEY'], algorithm="HS256")
|
||||
|
||||
return jsonify({
|
||||
|
||||
Reference in New Issue
Block a user