-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
85 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/* /index.html 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -153,5 +153,3 @@ function EditHostProfile() { | |
} | ||
|
||
export default EditHostProfile; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,9 @@ | ||
import { useContext } from "react"; | ||
import { Navigate } from "react-router-dom"; | ||
import { SessionContextHost } from "../contexts/SessionContextHost"; | ||
import { Loader } from "@mantine/core"; | ||
|
||
function PrivateRouteHost({ children }) { | ||
const { isAuthenticated, isLoading } = useContext(SessionContextHost); | ||
console.log({ isAuthenticated }); | ||
console.log({ isLoading }); | ||
if (isLoading) { | ||
return ( | ||
<div> | ||
<Loader color="grape" /> | ||
</div> | ||
); | ||
} | ||
return isAuthenticated ? <>{children}</> : <Navigate to="/host-login" />; | ||
function PrivateRouteHost({children}) { | ||
const {isAuthenticated} = useContext(SessionContextHost) | ||
return ( isAuthenticated ? <>{children}</> : <Navigate to="/error-page" />); | ||
} | ||
export default PrivateRouteHost; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,9 @@ | ||
import { useContext } from "react"; | ||
import { Navigate } from "react-router-dom"; | ||
import { SessionContextUser } from "../contexts/SessionContextUser"; | ||
import { Loader } from "@mantine/core"; | ||
|
||
function PrivateRouteUser({ children }) { | ||
const { isAuthenticated, isLoading } = useContext(SessionContextUser); | ||
console.log({ isAuthenticated }); | ||
console.log({ isLoading }); | ||
if (isLoading) { | ||
return ( | ||
<div> | ||
<Loader color="grape" /> | ||
</div> | ||
); | ||
} | ||
return isAuthenticated ? <>{children}</> : <Navigate to="/" />; | ||
const { isAuthenticated } = useContext(SessionContextUser); | ||
return isAuthenticated ? <>{children}</> : <Navigate to="/error-page" />; | ||
} | ||
export default PrivateRouteUser; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.