Куки сделал на 12 часов (дата истечения в самом токене есть)
This commit is contained in:
@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user