Куки сделал на 12 часов (дата истечения в самом токене есть)

This commit is contained in:
Igor I
2024-12-23 17:02:46 +05:00
parent 260b3f1d21
commit 9add3593c1

View File

@ -219,7 +219,7 @@ public class MainController implements ServletContextAware {
if (jwt_r == null || jwt_r.isEmpty()) { if (jwt_r == null || jwt_r.isEmpty()) {
maxAge = Duration.ZERO; // Удаляем куки maxAge = Duration.ZERO; // Удаляем куки
} else { } else {
maxAge = Duration.ofHours(12); // 12 часов maxAge = Duration.ofSeconds(refresh_time);
} }
// Создаем ResponseCookie с настройками // Создаем ResponseCookie с настройками
@ -247,7 +247,7 @@ public class MainController implements ServletContextAware {
if (jwt_a == null || jwt_a.isEmpty()) { if (jwt_a == null || jwt_a.isEmpty()) {
maxAge = Duration.ZERO; // Удаляем куки maxAge = Duration.ZERO; // Удаляем куки
} else { } else {
maxAge = Duration.ofSeconds(access_time); //В 2 раза больше maxAge = Duration.ofSeconds(refresh_time);
} }
// Создаем ResponseCookie с настройками // Создаем ResponseCookie с настройками
ResponseCookie cookie = ResponseCookie.from("jwt_a", jwt_a) ResponseCookie cookie = ResponseCookie.from("jwt_a", jwt_a)