diff --git a/client/src/App.tsx b/client/src/App.tsx
index 0106a54..f24698d 100644
--- a/client/src/App.tsx
+++ b/client/src/App.tsx
@@ -1,4 +1,4 @@
-import { BrowserRouter, Navigate, Outlet, Route, Routes } from 'react-router-dom';
+import { BrowserRouter, useNavigate, Outlet, Route, Routes } from 'react-router-dom';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import Login from './routes/login';
import Home from './routes/home';
diff --git a/client/src/controllers/Auth.ts b/client/src/controllers/Auth.ts
new file mode 100644
index 0000000..0bfea26
--- /dev/null
+++ b/client/src/controllers/Auth.ts
@@ -0,0 +1,13 @@
+import { useCookies } from "react-cookie";
+import { useNavigate } from "react-router-dom";
+
+const checkAuth = () => {
+ const [cookie, setCookie] = useCookies(['token']);
+
+ if (cookie.token && cookie.token !== '') {
+ return true;
+ }
+ return false;
+};
+
+export { checkAuth };
\ No newline at end of file
diff --git a/client/src/routes/home.tsx b/client/src/routes/home.tsx
index 8586d4e..673e602 100644
--- a/client/src/routes/home.tsx
+++ b/client/src/routes/home.tsx
@@ -1,14 +1,11 @@
-import { useCookies } from "react-cookie";
-import { Navigate } from "react-router-dom";
import AppHeader from "@components/AppHeader";
+import { Navigate } from "react-router-dom";
+import { checkAuth } from "../controllers/Auth";
const Home = () => {
- const [cookie, setCookie] = useCookies(["token"]);
-
- if (!cookie.token) {
+ if (!checkAuth()) {
return