This commit is contained in:
		| @@ -31,7 +31,7 @@ export default async function Blog({ | ||||
|   if (pageNumber > numberOfPages) { | ||||
|     notFound(); | ||||
|   } | ||||
|   const loggedIn = (await auth()) != null; | ||||
|   const loggedIn = (await auth())?.user != null; | ||||
|   const tags = await getTags(loggedIn); | ||||
|  | ||||
|   return ( | ||||
|   | ||||
| @@ -13,7 +13,7 @@ export default async function Post({ | ||||
|   if (!post) { | ||||
|     notFound(); | ||||
|   } | ||||
|   const loggedIn = (await auth()) != null; | ||||
|   const loggedIn = (await auth())?.user != null; | ||||
|   return ( | ||||
|     <> | ||||
|       <PostDisplay post={post} loggedIn={loggedIn} /> | ||||
|   | ||||
| @@ -9,7 +9,7 @@ export default async function WritePage({ | ||||
| }: { | ||||
|   params: Promise<{ slug: string[] | undefined }>; | ||||
| }) { | ||||
|   if (!(await auth())) { | ||||
|   if ((await auth())?.user == null) { | ||||
|     signIn(); | ||||
|   } | ||||
|  | ||||
|   | ||||
| @@ -14,7 +14,7 @@ export async function savePostServer( | ||||
|   is_draft: boolean, | ||||
|   existingSlug?: string | ||||
| ) { | ||||
|   if (!(await auth())) { | ||||
|   if ((await auth())?.user != null) { | ||||
|     throw new Error("Not authenticated"); | ||||
|   } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Nareshkumar Rao
					Nareshkumar Rao