From f7ed26231e2b26222d25741a7a5bb714b42fb385 Mon Sep 17 00:00:00 2001 From: Yared Yemane Date: Fri, 27 Feb 2026 04:42:34 -0800 Subject: [PATCH] login page navigation fix --- .env | 1 - src/pages/auth/LoginPage.tsx | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.env b/.env index 86dd9a4..ff1a1d8 100644 --- a/.env +++ b/.env @@ -1,3 +1,2 @@ VITE_API_BASE_URL=http://localhost:8080/api/v1 VITE_GOOGLE_CLIENT_ID=google_client_id -VERSION=1.0.0 diff --git a/src/pages/auth/LoginPage.tsx b/src/pages/auth/LoginPage.tsx index 3b1d522..722e93f 100644 --- a/src/pages/auth/LoginPage.tsx +++ b/src/pages/auth/LoginPage.tsx @@ -1,5 +1,5 @@ import { useState, useEffect, useRef, useCallback } from "react"; -import { Link, useNavigate } from "react-router-dom"; +import { Link, Navigate, useNavigate } from "react-router-dom"; import { Eye, EyeOff } from "lucide-react"; import { BrandLogo } from "../../components/brand/BrandLogo"; @@ -64,6 +64,11 @@ function GoogleIcon({ className }: { className?: string }) { export function LoginPage() { const navigate = useNavigate(); + const token = localStorage.getItem("access_token"); + if (token) { + return ; + } + const [showPassword, setShowPassword] = useState(false); const [email, setEmail] = useState(""); const [password, setPassword] = useState("");