Skip to content

Commit

Permalink
fix: route error
Browse files Browse the repository at this point in the history
  • Loading branch information
DevDAN09 committed Jun 7, 2024
1 parent 3e4386a commit 7a6aa68
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function App() {
<Routes>
<Route path="/" element={<Suspense><Main /></Suspense>} />
<Route path="/login" element={<Login />} />
<Route path="/home" element={<PrivateRoute><MainHome /></PrivateRoute>} />
<Route path="/home" element={<MainHome />} />
<Route path="/velog" element={<VelogPage />} />
</Routes>
</Router>
Expand All @@ -27,7 +27,7 @@ function App() {

const PrivateRoute = ({ children }) => {
const { isAuthenticated } = React.useContext(AuthContext);
return isAuthenticated ? children : <Navigate to="/velog" />;
return isAuthenticated ? children : <Navigate to="/main" />;
};

export default App;
Expand Down

0 comments on commit 7a6aa68

Please sign in to comment.