Added auth system, file upload system, file upload tests

This commit is contained in:
redtea committed 2022-08-29 00:05:38 +03:00
1 parent 2ba79f8058
commit cb9790fdd6
13 files changed
+332 -6

No files matched your search

+2 -5
View File
@@ -1,14 +1,11 @@
server.port=80
spring.main.banner-mode=off
logging.level.org.springframework=ERROR
spring.jpa.hibernate.ddl-auto=none
spring.jpa.hibernate.ddl-auto=create
spring.sql.init.mode=always
spring.sql.init.platform=postgres
spring.datasource.url=jdbc:postgresql://localhost:5432/testdb
spring.datasource.username=postgres
spring.datasource.password=root
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

+65
View File
@@ -0,0 +1,65 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="https://www.thymeleaf.org"
xmlns:sec="https://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
<meta charset="utf-8">
<title>Вход</title>
<style>
div.error {
color: #ff5967;
font-weight: bold;
}
div.logout {
color: #2c84ec;
font-weight: bold;
}
</style>
</head>
<body class="text-center">
<main>
<form th:action="@{/login}" method="post">
<h1>Пожалуйста, войдите</h1>
<div>
<input type="text" class="form-control" minlength="3" size="25" id="username" name="username" required placeholder="UserName">
<label for="username">Логин</label>
</div>
<div>
<input type="password" name="password" minlength="3" id="password" required placeholder="Password123">
<label for="password">Пароль</label>
</div>
<div>
<label>
<input type="checkbox" value="remember-me"> Запомнить меня
</label>
</div>
<button type="submit">Войти</button>
<div th:if="${param.error}" class="error">
Неправильный логин или пароль.
</div>
<div th:if="${param.logout}" class="logout">
Вы вышли из аккаунта.
</div>
<p>© 2022</p>
</form>
<a href="registration">Зарегистрироваться</a>
</main>
</body>
</html>
@@ -0,0 +1,42 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="https://www.thymeleaf.org"
xmlns:sec="https://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
<title>Регистрация</title>
</head>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="https://www.thymeleaf.org"
xmlns:sec="https://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
<meta charset="utf-8">
</head>
<body class="text-center">
<main class="form-signin w-100 m-auto">
<form th:action="@{/registration}" method="post">
<h1>Пожалуйста, зарегистрируйтесь</h1>
<div>
<input minlength="3" size="25" name="username" id="username" required placeholder="UserName">
<label for="username">Логин</label>
</div>
<div>
<input type="password" name="password" minlength="3" id="password" required placeholder="Password123">
<label for="password">Пароль</label>
</div>
<button type="submit">Зарегистрироваться</button>
<div>
<p th:text="${message}"></p>
</div>
<p>© 2022</p>
</form>
</main>
</body>
</html>