GT AI OS Community Edition v2.0.33
Security hardening release addressing CodeQL and Dependabot alerts: - Fix stack trace exposure in error responses - Add SSRF protection with DNS resolution checking - Implement proper URL hostname validation (replaces substring matching) - Add centralized path sanitization to prevent path traversal - Fix ReDoS vulnerability in email validation regex - Improve HTML sanitization in validation utilities - Fix capability wildcard matching in auth utilities - Update glob dependency to address CVE - Add CodeQL suppression comments for verified false positives 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
30
apps/control-panel-frontend/src/components/ui/use-toast.ts
Normal file
30
apps/control-panel-frontend/src/components/ui/use-toast.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import * as React from "react"
|
||||
import toast from 'react-hot-toast'
|
||||
|
||||
interface ToastOptions {
|
||||
title?: string;
|
||||
description?: string;
|
||||
variant?: "default" | "destructive";
|
||||
}
|
||||
|
||||
// Simple wrapper around react-hot-toast to match the expected interface
|
||||
export function useToast() {
|
||||
const toastFunction = (options: ToastOptions | string) => {
|
||||
if (typeof options === 'string') {
|
||||
return toast(options);
|
||||
}
|
||||
|
||||
const { title, description, variant } = options;
|
||||
const message = title && description ? `${title}: ${description}` : title || description || '';
|
||||
|
||||
if (variant === 'destructive') {
|
||||
return toast.error(message);
|
||||
} else {
|
||||
return toast.success(message);
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
toast: toastFunction
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user