타임리프 spring security 문법 참고 - Spring Security Dialect
<input에서 사용><input class="form-control" id="author" type="text" name="author" th:value="${ #authentication.name }" />
(코드 수정 전)

(코드 수정 후)
<!-- 로그인 사용자와 포스트 작성자가 같으면 -->
<div th:if="${#authentication.name} == ${post.author}">
<a class="my-2 btn btn-outline-primary" th:href="@{ /post/modify?id={id} (id=${post.id}) }">수정하기</a>
</div>

<주소 창 입력하여 들어올 경우 못 하게 처리)
(코드 수정 )
<div th:if="${#authentication.name} == ${post.author}">
<button class="my-2 btn btn-outline-danger" id="btnDelete" >삭제</button>
<button class="my-2 btn btn-outline-success" id="btnUpdate" >업데이트</button>
</div>
js 코드
for (let reply of data) {
htmlStr += `
<div class="card my-2">
<div>
<span class="d-none">${reply.id}</span>
<span class="fw-bold">${reply.writer}</span>
</div>
`;
if (authName === reply.writer) {
htmlStr += `
<textarea id="replyText_${reply.id}">${reply.replyText}</textarea>
<div>
<button class="btnDelete btn btn-outline-danger" data-id="${reply.id}">삭제</button>
<button class="btnMidify btn btn-outline-primary" data-id="${reply.id}">수정</button>
</div>
`;
} else {
htmlStr += `
<textarea id="replyText_${reply.id}" readonly>${reply.replyText}</textarea>
`;
}
htmlStr += '</div>';
}
