Remember me

This commit is contained in:
Anton Romanov 2024-05-10 21:24:11 +04:00
parent 7713078596
commit 0a8a5f2df4
3 changed files with 22 additions and 19 deletions

View File

@ -89,6 +89,7 @@ public class SecurityConfiguration {
.failureHandler(authenticationFailureHandler)
.permitAll()
)
.rememberMe(rememberMe -> rememberMe.key("uniqueAndSecret"))
.logout((logoutCustomizer) -> logoutCustomizer
.logoutSuccessHandler(logoutSuccessHandler)
.logoutSuccessUrl(Constants.LOGOUT_URL)

View File

@ -39,44 +39,42 @@
<nav class="navbar navbar-expand-lg navbar-dark fixed-top navbar-shrink" id="mainNav">
<div class="container">
<a class="navbar-brand js-scroll-trigger" href="/">NG-Tracker</a>
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse"
data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false"
<button class="navbar-toggler navbar-toggler-right" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
aria-label="Toggle navigation">
Menu
<i class="fa fa-bars"></i>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav text-uppercase ml-auto">
<li class="nav-item">
<a class="nav-link js-scroll-trigger" target="_blank" href="#landing">НИО-17</a>
</li>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link js-scroll-trigger" target="_blank" href="http://is.ulstu.ru">Сайт кафедры</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" target="_blank"
th:href="@{'http://timetable.athene.tech?filter='+${currentUser}}">Расписание</a>
th:href="@{'https://time.ulstu.ru/?filter='+${currentUser}}">Расписание</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" target="_blank" href="https://kias.rfbr.ru/">КИАС РФФИ</a>
<a class="nav-link js-scroll-trigger" target="_blank" href="https://www.rscf.ru/">РНФ</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
data-bs-toggle="dropdown" aria-expanded="true">
Профиль
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="/users/profile">Личный кабинет</a>
<a class="dropdown-item" href="/logout">Выход</a>
<a class="dropdown-item" data-toggle="modal" href="invite.html" data-target="#inviteModal">Пригласить</a>
<a class="dropdown-item" data-toggle="modal" data-target="#changePasswordModal">Сменить
пароль</a>
</div>
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
<li><a class="dropdown-item" href="/users/profile">Личный кабинет</a></li>
<li><a class="dropdown-item" href="/logout">Выход</a></li>
<li><a class="dropdown-item" data-toggle="modal" href="invite.html" data-target="#inviteModal">Пригласить</a>
</li>
<li><a class="dropdown-item" data-toggle="modal" data-target="#changePasswordModal">Сменить
пароль</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<div th:replace="~{users/inviteModal}"/>
<div th:replace="~{users/changePassword}"/>
<div class="container-fluid">

View File

@ -26,6 +26,10 @@
<input type="password" name="password" id="password" class="form-control"
placeholder="Пароль" required="true"/>
</div>
<div class="form-group">
Запомнить меня
<input type="checkbox" name="remember-me"/>
</div>
<button type="submit" class="btn btn-success btn-block">Войти</button>
<div class="form-group">
<small class="form-text text-muted">