Added JWT token process

This commit is contained in:
2025-06-09 22:34:19 +02:00
parent 8f76832f69
commit 326bd1bd72
2 changed files with 45 additions and 7 deletions

View File

@@ -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({