From 415b0ec7da02c07aad8fe85cfe0610ba9f4e5bd4 Mon Sep 17 00:00:00 2001 From: Alexander Alexeev Date: Mon, 12 Dec 2016 20:58:12 +0700 Subject: using thymeleaf spring security extension --- .../main/java/com/juick/www/configuration/WebSecurityConfig.java | 5 ++--- juick-spring-www/src/main/resources/messages.properties | 4 +++- juick-spring-www/src/main/resources/messages_en.properties | 6 ++++-- juick-spring-www/src/main/webapp/WEB-INF/templates/index.html | 6 +++++- .../main/webapp/WEB-INF/templates/layout/partial/navigation.html | 8 ++++---- 5 files changed, 18 insertions(+), 11 deletions(-) (limited to 'juick-spring-www/src/main') diff --git a/juick-spring-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java b/juick-spring-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java index d10f2532..692cf8cc 100644 --- a/juick-spring-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java +++ b/juick-spring-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java @@ -1,6 +1,6 @@ package com.juick.www.configuration; -import com.juick.entity.AnonymUser; +import com.juick.server.security.entities.JuickUser; import com.juick.service.UserService; import com.juick.service.security.JuickUserDetailsService; import org.springframework.context.annotation.Bean; @@ -9,7 +9,6 @@ import org.springframework.core.env.Environment; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; -import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.core.userdetails.UserDetailsService; import javax.annotation.Resource; @@ -38,7 +37,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { .antMatchers("/settings", "/pm/**").authenticated() .anyRequest().permitAll() .and() - .anonymous().principal(AnonymUser.INSTANCE) + .anonymous().principal(JuickUser.ANONYM_USER).authorities(JuickUser.ANONYM_AUTHORITY) .and() .sessionManagement().invalidSessionUrl("/") .and() diff --git a/juick-spring-www/src/main/resources/messages.properties b/juick-spring-www/src/main/resources/messages.properties index 201c1f2c..42494512 100644 --- a/juick-spring-www/src/main/resources/messages.properties +++ b/juick-spring-www/src/main/resources/messages.properties @@ -31,4 +31,6 @@ message.sendLoginToXmpp=Отправьте LOGIN на - Главная страница + Популярные + Микроблоги Juick: популярные записи Главная страница ! + + +
Главная страница !