Skip to content

Commit

Permalink
Added login check
Browse files Browse the repository at this point in the history
  • Loading branch information
cr4yfish committed Jul 13, 2023
1 parent c1940e8 commit e5e5230
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/post/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ export default function Post() {
const sendComment = async (e: FormEvent) => {
e.preventDefault();
if(replyCommentText.length < 1) return alert("Comment cannot be empty");

if(!session.jwt) return alert("You must be logged in to comment");

const data: CommentResponse = await fetch(`/api/createComment`, {
method: "POST",
headers: {
Expand Down

0 comments on commit e5e5230

Please sign in to comment.