20 lines
1.1 KiB
HTML
20 lines
1.1 KiB
HTML
|
|
<!DOCTYPE html>
|
||
|
|
<html lang="ko"
|
||
|
|
xmlns:th="http://www.thymeleaf.org"
|
||
|
|
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5"
|
||
|
|
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||
|
|
layout:decorate="~{layout/layout}">
|
||
|
|
<div layout:fragment="content">
|
||
|
|
<!-- Security config의 loginPage("url")와 action url과 동일하게 작성-->
|
||
|
|
<form action="/user/login" method="post">
|
||
|
|
<!-- Spring Security가 적용되면 POST 방식으로 보내는 모든 데이터는 csrf 토큰 값이 필요 -->
|
||
|
|
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
|
||
|
|
<p th:if="${loginError}" class="error">Wrong user or password</p>
|
||
|
|
<!-- 로그인 시 아이디의 name 애트리뷰트 값은 username -->
|
||
|
|
<!-- 파라미터명을 변경하고 싶을 경우 config class formlogin()에서 .usernameParameter("") 명시 -->
|
||
|
|
<input type="text" name="username" placeholder="아이디" />
|
||
|
|
<input type="password" name="password" placeholder="비밀번호" />
|
||
|
|
<button type="submit">로그인</button>
|
||
|
|
</form>
|
||
|
|
</div>
|
||
|
|
</html>
|