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) .failureHandler(authenticationFailureHandler)
.permitAll() .permitAll()
) )
.rememberMe(rememberMe -> rememberMe.key("uniqueAndSecret"))
.logout((logoutCustomizer) -> logoutCustomizer .logout((logoutCustomizer) -> logoutCustomizer
.logoutSuccessHandler(logoutSuccessHandler) .logoutSuccessHandler(logoutSuccessHandler)
.logoutSuccessUrl(Constants.LOGOUT_URL) .logoutSuccessUrl(Constants.LOGOUT_URL)

View File

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

View File

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