fix(auth): correct session check in sign-out page
Change !session to !session?.user to properly detect unauthenticated state. useSession() returns an object, not null.
This commit is contained in:
1 parent
cfa93da149
commit
3b5934dbfd
1 file changed
+2
-2
@@ -12,7 +12,7 @@ export default function SignOutPage() {
|
||||
const router = useRouter()
|
||||
|
||||
useEffect(() => {
|
||||
if (!session) {
|
||||
if (!session?.user) {
|
||||
router.push("/")
|
||||
}
|
||||
}, [session, router])
|
||||
@@ -22,7 +22,7 @@ export default function SignOutPage() {
|
||||
router.push("/")
|
||||
}
|
||||
|
||||
if (isPending || !session) {
|
||||
if (isPending || !session?.user) {
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user