created different file for the routes, and changes all the import
This commit is contained in:
1 parent
73b31778db
commit
45444ba8bd
4 files changed
+16
-6
No files matched your search
+3
-1
@@ -9,6 +9,7 @@ import { Label } from "@/components/ui/label";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||
import { CalendarDays, AlertCircle, Loader2 } from "lucide-react";
|
||||
import { ROUTES } from "@/lib/routes";
|
||||
|
||||
export default function LoginPage() {
|
||||
const { login, user, isLoading } = useAuth();
|
||||
@@ -20,7 +21,8 @@ export default function LoginPage() {
|
||||
|
||||
useEffect(() => {
|
||||
if (!isLoading && user) {
|
||||
router.replace(user.role === "manager" ? "/manager" : "/employee");
|
||||
// router.replace(user.role === "manager" ? "/manager" : "/employee");
|
||||
router.replace(user.role === "manager" ? ROUTES.manager : ROUTES.employee);
|
||||
}
|
||||
}, [user, isLoading, router]);
|
||||
|
||||
|
||||
Reference in new issue
Block a user