fix
All checks were successful
Build / build (push) Successful in 2m27s

This commit is contained in:
Nareshkumar Rao 2025-04-04 23:38:08 +02:00
parent 434536d1f2
commit 64e5fd3354
4 changed files with 4 additions and 4 deletions

View File

@ -31,7 +31,7 @@ export default async function Blog({
if (pageNumber > numberOfPages) { if (pageNumber > numberOfPages) {
notFound(); notFound();
} }
const loggedIn = (await auth()) != null; const loggedIn = (await auth())?.user != null;
const tags = await getTags(loggedIn); const tags = await getTags(loggedIn);
return ( return (

View File

@ -13,7 +13,7 @@ export default async function Post({
if (!post) { if (!post) {
notFound(); notFound();
} }
const loggedIn = (await auth()) != null; const loggedIn = (await auth())?.user != null;
return ( return (
<> <>
<PostDisplay post={post} loggedIn={loggedIn} /> <PostDisplay post={post} loggedIn={loggedIn} />

View File

@ -9,7 +9,7 @@ export default async function WritePage({
}: { }: {
params: Promise<{ slug: string[] | undefined }>; params: Promise<{ slug: string[] | undefined }>;
}) { }) {
if (!(await auth())) { if ((await auth())?.user == null) {
signIn(); signIn();
} }

View File

@ -14,7 +14,7 @@ export async function savePostServer(
is_draft: boolean, is_draft: boolean,
existingSlug?: string existingSlug?: string
) { ) {
if (!(await auth())) { if ((await auth())?.user != null) {
throw new Error("Not authenticated"); throw new Error("Not authenticated");
} }