diff --git a/app/api/(auth)/changePassword/route.ts b/app/api/(auth)/changePassword/route.ts index ebea934..da449f5 100644 --- a/app/api/(auth)/changePassword/route.ts +++ b/app/api/(auth)/changePassword/route.ts @@ -61,3 +61,60 @@ export async function POST(req: NextRequest) { ); } } + +function PasswordGenerator() { + const [password, setPassword] = useState(""); + const [showPassword, setShowPassword] = useState(false); + + const generatePassword = () => { + const length = 12; + const chars = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_+"; + let pass = ""; + for (let i = 0; i < length; i++) { + pass += chars.charAt(Math.floor(Math.random() * chars.length)); + } + setPassword(pass); + }; + + const copyToClipboard = () => { + navigator.clipboard.writeText(password); + alert("Password copied!"); + }; + + return ( +
+ +
+ + + + +
+
+ ); +} + +export default PasswordGenerator;