mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
Redirect unauthenticated users to login page instead of home
This commit is contained in:
5
.changeset/spicy-words-sing.md
Normal file
5
.changeset/spicy-words-sing.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"create-better-t-stack": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Redirect unauthenticated users to login page instead of home
|
||||||
@@ -17,7 +17,7 @@ function RouteComponent() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!session && !isPending) {
|
if (!session && !isPending) {
|
||||||
navigate({
|
navigate({
|
||||||
to: "/",
|
to: "/login",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [session, isPending]);
|
}, [session, isPending]);
|
||||||
|
|||||||
Reference in New Issue
Block a user