fix issues

This commit is contained in:
2026-01-01 20:31:05 +01:00
parent 9005a8327c
commit 206a03ec48
267 changed files with 3632 additions and 452 deletions

View File

@@ -1,7 +1,8 @@
'use client';
import { useState, FormEvent, type ChangeEvent } from 'react';
import { useState, useEffect, FormEvent, type ChangeEvent } from 'react';
import { useRouter } from 'next/navigation';
import { useAuth } from '@/lib/auth/AuthContext';
import Link from 'next/link';
import { motion } from 'framer-motion';
import {
@@ -30,6 +31,7 @@ interface SuccessState {
export default function ForgotPasswordPage() {
const router = useRouter();
const { session } = useAuth();
const [loading, setLoading] = useState(false);
const [errors, setErrors] = useState<FormErrors>({});
@@ -38,6 +40,13 @@ export default function ForgotPasswordPage() {
email: '',
});
// Check if user is already authenticated
useEffect(() => {
if (session) {
router.replace('/dashboard');
}
}, [session, router]);
const validateForm = (): boolean => {
const newErrors: FormErrors = {};