login page navigation fix
This commit is contained in:
parent
6f9323de27
commit
f7ed26231e
1
.env
1
.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
|
||||
|
|
|
|||
|
|
@ -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 <Navigate to="/dashboard" replace />;
|
||||
}
|
||||
|
||||
const [showPassword, setShowPassword] = useState(false);
|
||||
const [email, setEmail] = useState("");
|
||||
const [password, setPassword] = useState("");
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user