kcgFileManager/src/main/resources/templates/login.html

46 lines
1.9 KiB
HTML
Raw Normal View History

2021-11-25 06:00:10 +00:00
<!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}">
2021-11-29 09:38:48 +00:00
<th:block layout:fragment="css">
<style>
.form-signin{
width: 100%;
max-width: 330px;
padding: 15px;
margin: auto;
}
</style>
</th:block>
<div layout:fragment="content" class="form-signin text-center">
<main>
2021-11-25 06:00:10 +00:00
<!-- 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("") 명시 -->
2021-11-29 09:38:48 +00:00
<img class="mb-4" src="/docs/5.1/assets/brand/bootstrap-logo.svg" alt="" width="72" height="57">
<h1 class="h3 mb-3 fw-normal">Please sign in</h1>
<div class="form-floating">
<input type="text" class="form-control" id="username" name="username" placeholder="아이디">
<label for="username">아이디</label>
</div>
<div class="form-floating">
<input type="password" class="form-control" id="password" name="password" placeholder="비밀번호">
<label for="password">비밀번호</label>
</div>
<div class="checkbox mb-3">
<label>
<input type="checkbox" class="disabled" value="remember-me"> 계정저장(비활성화)
</label>
</div>
<button class="w-100 btn btn-lg btn-primary" type="submit">로그인</button>
2021-11-25 06:00:10 +00:00
</form>
2021-11-29 09:38:48 +00:00
</main>
</div>
2021-11-25 06:00:10 +00:00
</html>