Commit 4415469c authored by Yoon, Daeki's avatar Yoon, Daeki 😅
Browse files

require auth 프로필과 포스팅에 추가

parent be135196
...@@ -2,7 +2,7 @@ import React from "react"; ...@@ -2,7 +2,7 @@ import React from "react";
import { BrowserRouter, Route, Routes } from "react-router-dom"; import { BrowserRouter, Route, Routes } from "react-router-dom";
import "tailwindcss/tailwind.css"; import "tailwindcss/tailwind.css";
import { IntoPost } from "./post/intopost"; import { IntoPost } from "./post/intopost";
import { Login, Profile, Signup } from "./auth"; import { Login, Profile, RequireAuth, Signup } from "./auth";
import { Header, Body } from "./home"; import { Header, Body } from "./home";
import { Board } from "./board"; import { Board } from "./board";
import Posting from "./post/posting"; import Posting from "./post/posting";
...@@ -17,10 +17,24 @@ export const App = () => { ...@@ -17,10 +17,24 @@ export const App = () => {
<Route path="signup" element={<Signup />} /> <Route path="signup" element={<Signup />} />
<Route path="/" element={<Header />}> <Route path="/" element={<Header />}>
<Route index element={<Body />} /> <Route index element={<Body />} />
<Route path="posting" element={<Posting />} /> <Route
path="posting"
element={
<RequireAuth>
<Posting />
</RequireAuth>
}
/>
<Route path="board" element={<Board />} /> <Route path="board" element={<Board />} />
<Route path="post/:postId" element={<IntoPost />} /> <Route path="post/:postId" element={<IntoPost />} />
<Route path="profile" element={<Profile />} /> <Route
path="profile"
element={
<RequireAuth>
<Profile />
</RequireAuth>
}
/>
</Route> </Route>
</Route> </Route>
</Routes> </Routes>
......
export { default as Login } from "./login"; export { default as Login } from "./login";
export { default as Signup } from "./signup"; export { default as Signup } from "./signup";
export { default as Profile } from "./profile"; export { default as Profile } from "./profile";
export { RequireAuth } from "./RequireAuth";
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment