- Добавил reCaptcha
- Добавил поддержку rememberMe и хранение сессий в БД. https://www.youtube.com/watch?v=7cDpbAbhyjc&list=PLU2ftbIeotGpAYRP9Iv2KLIwK36-o_qYk&index=14
This commit is contained in:
@@ -4,14 +4,21 @@ spring.datasource.url=jdbc:mysql://${MYSQL_HOST:localhost}:3306/sweater_db
|
||||
spring.datasource.username=user
|
||||
spring.datasource.password=123456
|
||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
|
||||
spring.freemarker.expose-request-attributes=true
|
||||
spring.freemarker.expose-session-attributes=true
|
||||
spring.freemarker.suffix=.ftl
|
||||
upload.path=/home/kashey/soft/sweater/uploads
|
||||
hosting.path=http://localhost:8080
|
||||
|
||||
spring.mail.host=smtp.yandex.ru
|
||||
spring.mail.username=username@yandex.ru
|
||||
spring.mail.password=pa$$word
|
||||
spring.mail.port=465
|
||||
spring.mail.protocol=smtps
|
||||
mail.debug=true
|
||||
mail.debug=true
|
||||
|
||||
recaptcha.secret=
|
||||
spring.session.jdbc.serialize=java
|
||||
spring.session.jdbc.initialize-schema=always
|
||||
spring.session.jdbc.table-name=SPRING_SESSION
|
||||
|
||||
@@ -2,9 +2,14 @@
|
||||
<#import "parts/login.ftl" as l>
|
||||
|
||||
<@com.page>
|
||||
<#if Session?? && Session.SPRING_SECURITY_LAST_EXCEPTION??>
|
||||
<#if SPRING_SECURITY_LAST_EXCEPTION??>
|
||||
<div class="alert alert-danger" role="alert">
|
||||
${Session.SPRING_SECURITY_LAST_EXCEPTION.message}
|
||||
${SPRING_SECURITY_LAST_EXCEPTION.message}
|
||||
</div>
|
||||
</#if>
|
||||
<#if message??>
|
||||
<div <#if messageType??>class="alert alert-${messageType}" role="alert"</#if> >
|
||||
${message}
|
||||
</div>
|
||||
</#if>
|
||||
<@l.login "/login" false/>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.1.3/dist/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
|
||||
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -53,6 +53,14 @@
|
||||
</#if>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="g-recaptcha" data-sitekey="6LcB49sqAAAAAIvXz46_hEGqtYAzFYYGuY_Y9Rlg"></div>
|
||||
<#if captchaError??>
|
||||
<div class="alert alert-danger" role="alert">
|
||||
${captchaError}
|
||||
</div>
|
||||
</#if>
|
||||
</div>
|
||||
</#if>
|
||||
<#if !isRegistrationForm>
|
||||
<a href="/registration" class="btn btn-primary">Add new user</a>
|
||||
|
||||
Reference in New Issue
Block a user