This commit is contained in:
		| @@ -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 ( | ||||||
|   | |||||||
| @@ -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} /> | ||||||
|   | |||||||
| @@ -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(); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -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"); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Nareshkumar Rao
					Nareshkumar Rao