Skip to content

Commit

Permalink
feat: https to http
Browse files Browse the repository at this point in the history
  • Loading branch information
gogumalatte committed Nov 15, 2024
1 parent 77bf7ac commit 275c1c5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
4 changes: 4 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
rel="stylesheet"
/>
<meta name="theme-color" content="#000000" />
<meta
http-equiv="Content-Security-Policy"
content="upgrade-insecure-requests"
/>
<meta
name="description"
content="해양 생물들을 촬영하여 나만의 도감을 채워나가는 체험형 교육 서비스, 물멍"
Expand Down
18 changes: 8 additions & 10 deletions src/routes/TokenRouter.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
import {Outlet, useLocation, useNavigate} from "react-router-dom";
import { Outlet, useLocation, useNavigate } from "react-router-dom";

import { useEffect } from "react";
const TokenRouter = () => {

const location = useLocation();
const location = useLocation();
const navigate = useNavigate();
const isAuthPath = location.pathname === "/login" || location.pathname === "/signup";

useEffect(() => {
if(!localStorage.getItem("accessToken") && !isAuthPath){
const isAuthPath =
location.pathname === "/login" || location.pathname === "/signup";

useEffect(() => {
if (!localStorage.getItem("accessToken") && !isAuthPath) {
navigate("/login");
}

}, [location.pathname, isAuthPath, navigate]);
return (
<div>
<Outlet />
<Outlet />
</div>
);
};
Expand Down

0 comments on commit 275c1c5

Please sign in to comment.