<a href="javascript:void(0);" th:data-uri="@{|/question/delete/${question.id}|}"
class="delete btn btn-sm btn-outline-secondary" sec:authorize="isAuthenticated()"
th:if="${question.author != null and #authentication.getPrincipal().getUsername() == question.author.username}"
th:text="삭제"></a>
에서
#authentication.getPrincipal().getUsername()
이거나
<li sec:authorize="isAuthenticated()">
<a th:href="@{|/user/mypage/{}|}">
<span sec:authentication="principal.username"></span>
</a>님 환영합니다.
</li>
sec:authentication="principal.username"
둘중 한가지 방법을 선택해서 쓰면 된다.