diff --git a/src/main/java/de/bstly/board/businesslogic/EntryManager.java b/src/main/java/de/bstly/board/businesslogic/EntryManager.java index 8b35170..a51b78f 100644 --- a/src/main/java/de/bstly/board/businesslogic/EntryManager.java +++ b/src/main/java/de/bstly/board/businesslogic/EntryManager.java @@ -76,6 +76,19 @@ public class EntryManager { return entryRepository.findAllByComments(date, gravity, PageRequest.of(page, size)); } + /** + * Fetch by comments. + * + * @param date the date + * @param gravity the gravity + * @param page the page + * @param size the size + * @return the page + */ + public Page fetchByLastComment(Instant date, int page, int size) { + return entryRepository.findAllByLastComment(date, PageRequest.of(page, size)); + } + /** * Fetch by date. * diff --git a/src/main/java/de/bstly/board/businesslogic/UserManager.java b/src/main/java/de/bstly/board/businesslogic/UserManager.java index e167bc8..10a3b5a 100644 --- a/src/main/java/de/bstly/board/businesslogic/UserManager.java +++ b/src/main/java/de/bstly/board/businesslogic/UserManager.java @@ -57,30 +57,10 @@ public class UserManager implements UserDetailsService, SmartInitializingSinglet @Value("${bstly.board.ranking.gravity:1.2}") private double GRAVITY; - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ - /* - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) - */ + /* * @see org.springframework.security.core.userdetails.UserDetailsService#loadUserByUsername(java.lang.String) */ - /* - * @see - * de.bstly.board.businesslogic.LocalUserManager#loadUserByUsername(java.lang. - * String) - */ @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { LocalUser localUser = getByUsername(username); @@ -118,30 +98,10 @@ public class UserManager implements UserDetailsService, SmartInitializingSinglet return userDetails; } - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ + /* * @see org.springframework.beans.factory.SmartInitializingSingleton#afterSingletonsInstantiated() */ - /* - * - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ @Override public void afterSingletonsInstantiated() { if (!localUserRepository.exists(qLocalUser.roles.contains("ROLE_ADMIN"))) { diff --git a/src/main/java/de/bstly/board/controller/CommentController.java b/src/main/java/de/bstly/board/controller/CommentController.java index c99fd56..45679b7 100644 --- a/src/main/java/de/bstly/board/controller/CommentController.java +++ b/src/main/java/de/bstly/board/controller/CommentController.java @@ -52,13 +52,13 @@ public class CommentController extends BaseController { /** * Fetch by rank. * - * @param target the target - * @param parent the parent - * @param pageParameter the page parameter - * @param sizeParameter the size parameter - * @param dateParameter the date parameter + * @param target the target + * @param parent the parent + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @param dateParameter the date parameter * @param gravityParameter the gravity parameter - * @param ignoreParameter the ignore parameter + * @param ignoreParameter the ignore parameter * @return the page */ @PreAuthorize("isAuthenticated()") @@ -79,12 +79,12 @@ public class CommentController extends BaseController { /** * Fetch by date. * - * @param target the target - * @param parent the parent - * @param pageParameter the page parameter - * @param sizeParameter the size parameter - * @param dateParameter the date parameter - * @param descParameter the desc parameter + * @param target the target + * @param parent the parent + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @param dateParameter the date parameter + * @param descParameter the desc parameter * @param ignoreParameter the ignore parameter * @return the page */ @@ -109,12 +109,12 @@ public class CommentController extends BaseController { /** * Fetch by username. * - * @param username the username - * @param parent the parent - * @param pageParameter the page parameter - * @param sizeParameter the size parameter - * @param dateParameter the date parameter - * @param ascParameter the asc parameter + * @param username the username + * @param parent the parent + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @param dateParameter the date parameter + * @param ascParameter the asc parameter * @param ignoreParameter the ignore parameter * @return the page */ @@ -152,7 +152,7 @@ public class CommentController extends BaseController { /** * Gets the comment. * - * @param id the id + * @param id the id * @param ignoreParameter the ignore parameter * @return the comment */ @@ -174,7 +174,7 @@ public class CommentController extends BaseController { /** * Creates the comment. * - * @param comment the comment + * @param comment the comment * @param ignoreParameter the ignore parameter * @return the comment */ diff --git a/src/main/java/de/bstly/board/controller/EntryController.java b/src/main/java/de/bstly/board/controller/EntryController.java index c7859ad..4d503f9 100644 --- a/src/main/java/de/bstly/board/controller/EntryController.java +++ b/src/main/java/de/bstly/board/controller/EntryController.java @@ -3,9 +3,14 @@ */ package de.bstly.board.controller; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLDecoder; import java.time.Instant; import java.util.List; import java.util.Optional; +import java.util.Scanner; import java.util.stream.Collectors; import org.springframework.beans.factory.annotation.Autowired; @@ -96,7 +101,35 @@ public class EntryController extends BaseController { } /** - * Fetch by ranking. + * Fetch by date. + * + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @param dateParameter the date parameter + * @param ignoreParameter the ignore parameter + * @return the page + */ + @PreAuthorize("isAuthenticated()") + @GetMapping("/new") + public Page fetchByDate(@RequestParam("page") Optional pageParameter, + @RequestParam("size") Optional sizeParameter, + @RequestParam("date") Optional dateParameter, + @RequestParam("ignore") Optional> ignoreParameter) { + + if (sizeParameter.isPresent() && sizeParameter.get() > 100) { + sizeParameter = Optional.of(100); + } + + Page entries = entryManager.fetchByDate(dateParameter.orElse(Instant.now()), + pageParameter.orElse(0), sizeParameter.orElse(SIZE)); + List ignore = ignoreParameter.orElse(Lists.newArrayList()); + entryManager.applyMetadata(getCurrentUsername(), userManager.getKarma(getCurrentUsername()), + entries.getContent(), ignore); + return entries; + } + + /** + * Fetch by comments. * * @param pageParameter the page parameter * @param sizeParameter the size parameter @@ -134,17 +167,18 @@ public class EntryController extends BaseController { } /** - * Fetch by date. + * Fetch by comments. * - * @param pageParameter the page parameter - * @param sizeParameter the size parameter - * @param dateParameter the date parameter - * @param ignoreParameter the ignore parameter + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @param dateParameter the date parameter + * @param gravityParameter the gravity parameter + * @param ignoreParameter the ignore parameter * @return the page */ @PreAuthorize("isAuthenticated()") - @GetMapping("/new") - public Page fetchByDate(@RequestParam("page") Optional pageParameter, + @GetMapping("/last") + public Page fetchByLast(@RequestParam("page") Optional pageParameter, @RequestParam("size") Optional sizeParameter, @RequestParam("date") Optional dateParameter, @RequestParam("ignore") Optional> ignoreParameter) { @@ -153,8 +187,9 @@ public class EntryController extends BaseController { sizeParameter = Optional.of(100); } - Page entries = entryManager.fetchByDate(dateParameter.orElse(Instant.now()), + Page entries = entryManager.fetchByLastComment(dateParameter.orElse(Instant.now()), pageParameter.orElse(0), sizeParameter.orElse(SIZE)); + List ignore = ignoreParameter.orElse(Lists.newArrayList()); entryManager.applyMetadata(getCurrentUsername(), userManager.getKarma(getCurrentUsername()), entries.getContent(), ignore); @@ -256,4 +291,36 @@ public class EntryController extends BaseController { return entry; } + /** + * Gets the title. + * + * @param url the url + * @return the title + */ + @PreAuthorize("isAuthenticated()") + @GetMapping("/helper/title") + public String getTitle(@RequestParam("url") String url) { + InputStream response = null; + Scanner scanner = null; + try { + response = new URL(URLDecoder.decode(url, "utf-8")).openStream(); + scanner = new Scanner(response); + String responseBody = scanner.useDelimiter("\\A").next(); + return responseBody.substring(responseBody.indexOf("") + 7, + responseBody.indexOf("")); + } catch (IOException ex) { + } finally { + try { + if (response != null) { + response.close(); + } + if (scanner != null) { + scanner.close(); + } + } catch (IOException ex) { + } + } + return ""; + } + } diff --git a/src/main/java/de/bstly/board/controller/VoteController.java b/src/main/java/de/bstly/board/controller/VoteController.java index 8302994..ce06841 100644 --- a/src/main/java/de/bstly/board/controller/VoteController.java +++ b/src/main/java/de/bstly/board/controller/VoteController.java @@ -4,6 +4,7 @@ package de.bstly.board.controller; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpStatus; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.DeleteMapping; @@ -15,13 +16,13 @@ import org.springframework.web.bind.annotation.RestController; import de.bstly.board.businesslogic.CommentManager; import de.bstly.board.businesslogic.EntryManager; +import de.bstly.board.businesslogic.UserManager; import de.bstly.board.businesslogic.VoteManager; import de.bstly.board.controller.support.EntityResponseStatusException; import de.bstly.board.model.Types; import de.bstly.board.model.Vote; import de.bstly.board.model.VoteType; - /** * The Class VoteController. */ @@ -29,17 +30,17 @@ import de.bstly.board.model.VoteType; @RequestMapping("/votes") public class VoteController extends BaseController { - @Autowired private VoteManager voteManager; - - @Autowired private EntryManager entryManager; - - @Autowired private CommentManager commentManager; + @Autowired + private UserManager userManager; + + @Value("${bstly.board.unvoteThresh:10}") + private long UNVOTE_THRESH; /** * Gets the entry points. @@ -95,6 +96,10 @@ public class VoteController extends BaseController { throw new EntityResponseStatusException(HttpStatus.UNPROCESSABLE_ENTITY); } + if (userManager.getKarma(getCurrentUsername()) < UNVOTE_THRESH) { + throw new EntityResponseStatusException(HttpStatus.FORBIDDEN); + } + Vote vote = voteManager.get(getCurrentUsername(), Types.entry, id); if (vote == null) { vote = new Vote(); diff --git a/src/main/java/de/bstly/board/controller/support/EntityResponseStatusException.java b/src/main/java/de/bstly/board/controller/support/EntityResponseStatusException.java index 36bd451..75a3823 100644 --- a/src/main/java/de/bstly/board/controller/support/EntityResponseStatusException.java +++ b/src/main/java/de/bstly/board/controller/support/EntityResponseStatusException.java @@ -78,6 +78,7 @@ public class EntityResponseStatusException extends NestedRuntimeException { return this.body; } + /* * @see org.springframework.core.NestedRuntimeException#getMessage() */ diff --git a/src/main/java/de/bstly/board/controller/support/JsonStringBodyControllerAdvice.java b/src/main/java/de/bstly/board/controller/support/JsonStringBodyControllerAdvice.java new file mode 100644 index 0000000..f93b0bb --- /dev/null +++ b/src/main/java/de/bstly/board/controller/support/JsonStringBodyControllerAdvice.java @@ -0,0 +1,94 @@ +/** + * + */ +package de.bstly.board.controller.support; + +import java.io.IOException; +import java.lang.reflect.Type; + +import org.springframework.core.MethodParameter; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpInputMessage; +import org.springframework.http.MediaType; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.converter.StringHttpMessageConverter; +import org.springframework.http.server.ServerHttpRequest; +import org.springframework.http.server.ServerHttpResponse; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice; +import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice; + +import com.google.gson.Gson; +import com.google.gson.JsonPrimitive; + +/** + * The Class JsonStringBodyControllerAdvice. + */ +@ControllerAdvice +public class JsonStringBodyControllerAdvice implements RequestBodyAdvice, ResponseBodyAdvice { + + private Gson gson = new Gson(); + + + /* + * @see org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice#supports(org.springframework.core.MethodParameter, java.lang.reflect.Type, java.lang.Class) + */ + @Override + public boolean supports(MethodParameter methodParameter, Type targetType, + Class> converterType) { + return targetType instanceof Class && String.class.equals((Class) targetType); + } + + + /* + * @see org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice#beforeBodyRead(org.springframework.http.HttpInputMessage, org.springframework.core.MethodParameter, java.lang.reflect.Type, java.lang.Class) + */ + @Override + public HttpInputMessage beforeBodyRead(HttpInputMessage inputMessage, MethodParameter parameter, Type targetType, + Class> converterType) throws IOException { + return inputMessage; + } + + + /* + * @see org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice#afterBodyRead(java.lang.Object, org.springframework.http.HttpInputMessage, org.springframework.core.MethodParameter, java.lang.reflect.Type, java.lang.Class) + */ + @Override + public Object afterBodyRead(Object body, HttpInputMessage inputMessage, MethodParameter parameter, Type targetType, + Class> converterType) { + body = ((String) body).replaceAll("^\"|\"$", ""); + return body; + } + + + /* + * @see org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice#handleEmptyBody(java.lang.Object, org.springframework.http.HttpInputMessage, org.springframework.core.MethodParameter, java.lang.reflect.Type, java.lang.Class) + */ + @Override + public Object handleEmptyBody(Object body, HttpInputMessage inputMessage, MethodParameter parameter, + Type targetType, Class> converterType) { + return body; + } + + + /* + * @see org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice#supports(org.springframework.core.MethodParameter, java.lang.Class) + */ + @Override + public boolean supports(MethodParameter returnType, Class> converterType) { + return converterType == StringHttpMessageConverter.class; + } + + + /* + * @see org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice#beforeBodyWrite(java.lang.Object, org.springframework.core.MethodParameter, org.springframework.http.MediaType, java.lang.Class, org.springframework.http.server.ServerHttpRequest, org.springframework.http.server.ServerHttpResponse) + */ + @Override + public String beforeBodyWrite(String body, MethodParameter returnType, MediaType selectedContentType, + Class> selectedConverterType, ServerHttpRequest request, + ServerHttpResponse response) { + response.getHeaders().set(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE); + return gson.toJson(new JsonPrimitive(body)); + } + +} \ No newline at end of file diff --git a/src/main/java/de/bstly/board/controller/support/RequestBodyErrors.java b/src/main/java/de/bstly/board/controller/support/RequestBodyErrors.java index 5f49de0..841efdf 100644 --- a/src/main/java/de/bstly/board/controller/support/RequestBodyErrors.java +++ b/src/main/java/de/bstly/board/controller/support/RequestBodyErrors.java @@ -35,14 +35,10 @@ public class RequestBodyErrors extends AbstractBindingResult { return target; } + /* * @see org.springframework.validation.AbstractBindingResult#getActualFieldValue(java.lang.String) */ - /* - * @see - * org.springframework.validation.AbstractBindingResult#getActualFieldValue(java - * .lang.String) - */ @Override protected Object getActualFieldValue(String field) { // Not necessary diff --git a/src/main/java/de/bstly/board/controller/validation/CommentValidator.java b/src/main/java/de/bstly/board/controller/validation/CommentValidator.java index ab448ce..5d83770 100644 --- a/src/main/java/de/bstly/board/controller/validation/CommentValidator.java +++ b/src/main/java/de/bstly/board/controller/validation/CommentValidator.java @@ -20,14 +20,12 @@ import de.bstly.board.model.Comment; @Component public class CommentValidator implements Validator { - @Autowired private CommentManager commentManager; - - @Autowired private EntryManager entryManager; + /* * @see org.springframework.validation.Validator#supports(java.lang.Class) */ @@ -36,9 +34,9 @@ public class CommentValidator implements Validator { return clazz.isAssignableFrom(Comment.class); } + /* - * @see org.springframework.validation.Validator#validate(java.lang.Object, - * org.springframework.validation.Errors) + * @see org.springframework.validation.Validator#validate(java.lang.Object, org.springframework.validation.Errors) */ @Override public void validate(Object target, Errors errors) { diff --git a/src/main/java/de/bstly/board/controller/validation/EntryValidator.java b/src/main/java/de/bstly/board/controller/validation/EntryValidator.java index d7b4ca5..5e7f1b9 100644 --- a/src/main/java/de/bstly/board/controller/validation/EntryValidator.java +++ b/src/main/java/de/bstly/board/controller/validation/EntryValidator.java @@ -20,6 +20,7 @@ public class EntryValidator implements Validator { private UrlValidator urlValidator = new UrlValidator(); + /* * @see org.springframework.validation.Validator#supports(java.lang.Class) */ @@ -28,9 +29,9 @@ public class EntryValidator implements Validator { return clazz.isAssignableFrom(Entry.class); } + /* - * @see org.springframework.validation.Validator#validate(java.lang.Object, - * org.springframework.validation.Errors) + * @see org.springframework.validation.Validator#validate(java.lang.Object, org.springframework.validation.Errors) */ @Override public void validate(Object target, Errors errors) { diff --git a/src/main/java/de/bstly/board/i18n/businesslogic/I18nManager.java b/src/main/java/de/bstly/board/i18n/businesslogic/I18nManager.java index f5b0559..9ca14b4 100644 --- a/src/main/java/de/bstly/board/i18n/businesslogic/I18nManager.java +++ b/src/main/java/de/bstly/board/i18n/businesslogic/I18nManager.java @@ -158,13 +158,10 @@ public class I18nManager implements SmartInitializingSingleton { } } + /* * @see org.springframework.beans.factory.SmartInitializingSingleton#afterSingletonsInstantiated() */ - /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() - */ @Override public void afterSingletonsInstantiated() { try { diff --git a/src/main/java/de/bstly/board/repository/EntryRepository.java b/src/main/java/de/bstly/board/repository/EntryRepository.java index 724481a..354d696 100644 --- a/src/main/java/de/bstly/board/repository/EntryRepository.java +++ b/src/main/java/de/bstly/board/repository/EntryRepository.java @@ -27,7 +27,7 @@ public interface EntryRepository static final String DOWNVOTES_QUERY = "SELECT downvote.target,COUNT(downvote.id) AS count FROM votes as downvote WHERE downvote.type = 1 AND downvote.target_type = 1 GROUP BY downvote.target"; - static final String COMMENTS_QUERY = "SELECT comment.target,COUNT(comment.id) AS count FROM comments as comment GROUP BY comment.target"; + static final String COMMENTS_QUERY = "SELECT comment.target,MAX(comment.created) as last,COUNT(comment.id) AS count FROM comments as comment GROUP BY comment.target"; static final String RANK_CALCULATION_QUERY = "SELECT entry.*, (IFNULL(upvote.count,0) - IFNULL(downvote.count,0)) as points, (IFNULL(upvote.count,0) - IFNULL(downvote.count,0)) / POW(TIMESTAMPDIFF(HOUR, entry.created, :before)+2,:gravity) AS ranking FROM entries AS entry LEFT JOIN (" + UPVOTES_QUERY @@ -35,10 +35,14 @@ public interface EntryRepository + DOWNVOTES_QUERY + ") AS downvote ON downvote.target = entry.id WHERE entry.created < :before AND entry.entry_status = 'NORMAL' ORDER BY ranking DESC, entry.created DESC"; - static final String COMMENT_CALCULATION_QUERY = "SELECT entry.*, IFNULL(comment.count,0) as comments, IFNULL(comment.count,0) / POW(TIMESTAMPDIFF(HOUR, entry.created, :before)+2,:gravity) AS ranking FROM entries AS entry LEFT JOIN (" + static final String COMMENT_CALCULATION_QUERY = "SELECT entry.*, IFNULL(comment.count,0) as comments, IFNULL(comment.count,0) / POW(TIMESTAMPDIFF(HOUR, comment.last, :before)+2,:gravity) AS ranking FROM entries AS entry LEFT JOIN (" + COMMENTS_QUERY + ") AS comment ON comment.target = entry.id WHERE entry.created < :before AND entry.entry_status = 'NORMAL' ORDER BY ranking DESC, entry.created DESC"; + static final String LAST_COMMENT_QUERY = "SELECT entry.* FROM entries AS entry LEFT JOIN (" + + COMMENTS_QUERY + + ") AS comment ON comment.target = entry.id WHERE entry.created < :before AND entry.entry_status = 'NORMAL' ORDER BY comment.last DESC, entry.created DESC"; + static final String ARCHIVE_CALCULATION_QUERY = "SELECT entry.*, (IFNULL(upvote.count,0) - IFNULL(downvote.count,0)) as points, (IFNULL(upvote.count,0) - IFNULL(downvote.count,0)) / POW(TIMESTAMPDIFF(HOUR, entry.created, :before)+2,:gravity) AS ranking FROM entries AS entry LEFT JOIN (" + UPVOTES_QUERY + ") AS upvote ON upvote.target = entry.id LEFT JOIN (" @@ -75,6 +79,17 @@ public interface EntryRepository Page findAllByComments(@Param("before") Instant before, @Param("gravity") double gravity, Pageable pageable); + /** + * Find all by comments. + * + * @param before the before + * @param gravity the gravity + * @param pageable the pageable + * @return the page + */ + @Query(value = LAST_COMMENT_QUERY, countQuery = COUNT_QUERY, nativeQuery = true) + Page findAllByLastComment(@Param("before") Instant before, Pageable pageable); + /** * Find all by ranking archive. * diff --git a/src/main/java/de/bstly/board/security/LocalRememberMeServices.java b/src/main/java/de/bstly/board/security/LocalRememberMeServices.java index 6d81d3b..c966312 100644 --- a/src/main/java/de/bstly/board/security/LocalRememberMeServices.java +++ b/src/main/java/de/bstly/board/security/LocalRememberMeServices.java @@ -27,15 +27,10 @@ public class LocalRememberMeServices extends PersistentTokenBasedRememberMeServi super(key, userDetailsService, tokenRepository); } + /* * @see org.springframework.security.web.authentication.rememberme.AbstractRememberMeServices#rememberMeRequested(javax.servlet.http.HttpServletRequest, java.lang.String) */ - /* - * - * @see org.springframework.security.web.authentication.rememberme. - * AbstractRememberMeServices#rememberMeRequested(javax.servlet.http. - * HttpServletRequest, java.lang.String) - */ @Override protected boolean rememberMeRequested(HttpServletRequest request, String parameter) { Object value = request.getAttribute(parameter); diff --git a/src/main/java/de/bstly/board/security/OAuth2AuthenticationSuccessHandler.java b/src/main/java/de/bstly/board/security/OAuth2AuthenticationSuccessHandler.java index 7602b23..6565577 100644 --- a/src/main/java/de/bstly/board/security/OAuth2AuthenticationSuccessHandler.java +++ b/src/main/java/de/bstly/board/security/OAuth2AuthenticationSuccessHandler.java @@ -37,15 +37,10 @@ public class OAuth2AuthenticationSuccessHandler private RememberMeServices rememberMeServices; + /* * @see org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler#onAuthenticationSuccess(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.springframework.security.core.Authentication) */ - /* - * @see org.springframework.security.web.authentication. - * SavedRequestAwareAuthenticationSuccessHandler#onAuthenticationSuccess(javax. - * servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, - * org.springframework.security.core.Authentication) - */ @Override public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException { diff --git a/src/main/java/de/bstly/board/security/SecurityConfig.java b/src/main/java/de/bstly/board/security/SecurityConfig.java index 3ee337f..a8b1fe0 100755 --- a/src/main/java/de/bstly/board/security/SecurityConfig.java +++ b/src/main/java/de/bstly/board/security/SecurityConfig.java @@ -53,15 +53,10 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { @Value("${loginTargetUrl:/}") private String loginTargetUrl; + /* * @see org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter#configure(org.springframework.security.config.annotation.web.builders.HttpSecurity) */ - /* - * - * @see org.springframework.security.config.annotation.web.configuration. - * WebSecurityConfigurerAdapter#configure(org.springframework.security.config. - * annotation.web.builders.HttpSecurity) - */ @Override protected void configure(HttpSecurity http) throws Exception {