mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-05-13 13:17:45 +00:00
fix: 404 on profiles when not logged in
This commit is contained in:
parent
94eef81b93
commit
50bad620ce
1 changed files with 3 additions and 2 deletions
|
|
@ -15,8 +15,9 @@ export default function ProfileLayout() {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if ($session === undefined) return; // session still loading
|
if ($session === undefined) return; // session still loading
|
||||||
if ($session === null) {
|
|
||||||
// not logged in
|
const userId = id ?? $session?.user?.id;
|
||||||
|
if (!userId) {
|
||||||
navigate("/404");
|
navigate("/404");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue