Allow image uploads in lesson comments

Add an image button to the comment toolbar backed by a new upload route
(images only, 5 MB, stored under comments/<userId>/), inserted as Markdown.

Only images served from our own storage are rendered: a third-party src would
be fetched by every reader of the lesson, exposing their address. Such links
are shown as plain links instead — this also defuses the external images a few
existing comments already carry.
This commit is contained in:
2026-08-06 11:41:19 +05:00
parent 917253990b
commit 005cd329b2
4 changed files with 138 additions and 5 deletions
@@ -289,6 +289,7 @@ export default async function LessonPage({ params }: Props) {
comments={comments}
currentUserId={session.user.id}
currentUserRole={session.user.role ?? "student"}
imageHost={process.env.S3_CDN_URL ?? ""}
/>
</div>
)}