From 0a8a5f2df47374a6260611f345adc225add7df8f Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Fri, 10 May 2024 21:24:11 +0400 Subject: [PATCH] Remember me --- .../configuration/SecurityConfiguration.java | 1 + src/main/resources/templates/default.html | 36 +++++++++---------- src/main/resources/templates/login.html | 4 +++ 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/main/java/ru/ulstu/configuration/SecurityConfiguration.java b/src/main/java/ru/ulstu/configuration/SecurityConfiguration.java index ea90028..23d8c6f 100644 --- a/src/main/java/ru/ulstu/configuration/SecurityConfiguration.java +++ b/src/main/java/ru/ulstu/configuration/SecurityConfiguration.java @@ -89,6 +89,7 @@ public class SecurityConfiguration { .failureHandler(authenticationFailureHandler) .permitAll() ) + .rememberMe(rememberMe -> rememberMe.key("uniqueAndSecret")) .logout((logoutCustomizer) -> logoutCustomizer .logoutSuccessHandler(logoutSuccessHandler) .logoutSuccessUrl(Constants.LOGOUT_URL) diff --git a/src/main/resources/templates/default.html b/src/main/resources/templates/default.html index 778f774..9b20aa0 100644 --- a/src/main/resources/templates/default.html +++ b/src/main/resources/templates/default.html @@ -39,44 +39,42 @@ +
diff --git a/src/main/resources/templates/login.html b/src/main/resources/templates/login.html index bc6a3a0..b5c6c61 100644 --- a/src/main/resources/templates/login.html +++ b/src/main/resources/templates/login.html @@ -26,6 +26,10 @@
+
+ Запомнить меня + +