Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
thecybernanny-webapp
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
asranov0003
thecybernanny-webapp
Commits
18157566
Commit
18157566
authored
Jul 03, 2025
by
asranov0003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: create browser router
parent
a0584e8a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
17 deletions
+10
-17
Router.tsx
src/routes/Router.tsx
+10
-17
No files found.
src/routes/Router.tsx
View file @
18157566
...
...
@@ -22,33 +22,26 @@ const Router: React.FC = () => {
const
router
=
createBrowserRouter
([
{
path
:
"/auth"
,
path
:
"/"
,
element
:
isAuthenticated
&&
<
Navigate
to=
{
"/home"
}
/>,
children
:
[
{
index
:
true
,
element
:
isAuthenticated
?
(
<
Navigate
to=
"/home"
/>
)
:
(
<
Navigate
to=
"/auth/login"
/>
),
},
{
path
:
"login"
,
element
:
isAuthenticated
?
<
Navigate
to=
"/home"
/>
:
<
Login
/>,
path
:
"/auth/login"
,
element
:
<
Login
/>,
},
{
path
:
"register"
,
element
:
isAuthenticated
?
<
Navigate
to=
"/home"
/>
:
<
Register
/>,
path
:
"
/auth/
register"
,
element
:
<
Register
/>,
},
{
path
:
"recover"
,
element
:
isAuthenticated
?
<
Navigate
to=
"/home"
/>
:
<
Recover
/>,
path
:
"
/auth/
recover"
,
element
:
<
Recover
/>,
},
],
},
{
path
:
"/"
,
element
:
<
ProtectedRoute
element=
{
<
Layout
/>
}
redirectTo=
"/
auth/login
"
/>,
element
:
<
ProtectedRoute
element=
{
<
Layout
/>
}
redirectTo=
"/"
/>,
children
:
[
{
path
:
"home"
,
...
...
@@ -70,7 +63,7 @@ const Router: React.FC = () => {
},
{
path
:
"/pincode"
,
element
:
isAuthenticated
?
<
Pincode
/>
:
<
Navigate
to=
"/auth/login"
/>,
element
:
<
Pincode
/>,
},
{
path
:
"*"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment