aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/www/controllers/Settings.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2022-12-08 07:26:58 +0300
committerGravatar Vitaly Takmazov2022-12-08 07:26:58 +0300
commit7b8a99a6074228a5680218690b7f1538ce7e8d1d (patch)
tree1a5803430b00737b3f36f79d3ecc4cdf40af6584 /src/main/java/com/juick/www/controllers/Settings.java
parent5e0500933d2f805fe879ced9171c65839c72579b (diff)
Cleanup unused authorization checks handled by spring-security
Diffstat (limited to 'src/main/java/com/juick/www/controllers/Settings.java')
-rw-r--r--src/main/java/com/juick/www/controllers/Settings.java13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/main/java/com/juick/www/controllers/Settings.java b/src/main/java/com/juick/www/controllers/Settings.java
index 1e40b9d1..0b486766 100644
--- a/src/main/java/com/juick/www/controllers/Settings.java
+++ b/src/main/java/com/juick/www/controllers/Settings.java
@@ -91,18 +91,13 @@ public class Settings {
protected String doGet(
@Visitor User visitor,
Locale locale,
- HttpServletRequest request,
- HttpServletResponse response, ModelMap model) throws IOException {
- if (visitor.isAnonymous()) {
- response.sendRedirect("/login");
- }
+ @RequestParam(required = false, defaultValue = "main") String page,
+ @RequestParam(required = false) String code, ModelMap model) throws IOException {
visitor.setAvatar(webApp.getAvatarWebPath(visitor));
List<String> pages = Arrays.asList("main", "password", "about", "auth-email", "privacy");
- String page = request.getParameter("page");
- if (StringUtils.isEmpty(page) || !pages.contains(page)) {
+ if (!pages.contains(page)) {
page = "main";
}
-
model.addAttribute("title", ResourceBundle.getBundle("messages", locale).getString("link.settings"));
model.addAttribute("visitor", visitor);
model.addAttribute("tags", tagService.getPopularTags());
@@ -120,7 +115,7 @@ public class Settings {
model.addAttribute("notify_options", subscriptionService.getNotifyOptions(visitor));
model.addAttribute("userinfo", userService.getUserInfo(visitor));
if (page.equals("auth-email")) {
- if (emailService.verifyAddressByCode(visitor.getUid(), request.getParameter("code"))) {
+ if (emailService.verifyAddressByCode(visitor.getUid(), code)) {
model.addAttribute("result", "OK!");
} else {
model.addAttribute("result", "Sorry, code unknown.");