diff options
author | Vitaly Takmazov | 2017-03-27 13:20:20 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2017-03-27 13:20:20 +0300 |
commit | 77aa3f0080575c583fdbd27ce6d216016d764574 (patch) | |
tree | 9b3f708727f6d844146329f68d6643b472291e1d /juick-www/src/main | |
parent | 31eb48182cb9b2382996671c884c52cffe683fa3 (diff) |
juick-www: fix adding email
Diffstat (limited to 'juick-www/src/main')
-rw-r--r-- | juick-www/src/main/java/com/juick/www/controllers/Settings.java | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/juick-www/src/main/java/com/juick/www/controllers/Settings.java b/juick-www/src/main/java/com/juick/www/controllers/Settings.java index e6e763b1..053a014e 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/Settings.java +++ b/juick-www/src/main/java/com/juick/www/controllers/Settings.java @@ -29,7 +29,6 @@ import org.apache.commons.lang3.StringUtils; import org.imgscalr.Scalr; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.dao.EmptyResultDataAccessException; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; @@ -209,9 +208,7 @@ public class Settings { } break; case "email-add": - try { - emailService.verifyAddressByCode(visitor.getUid(), request.getParameter("account")); - } catch (EmptyResultDataAccessException e) { + if (!emailService.verifyAddressByCode(visitor.getUid(), request.getParameter("account"))) { String authCode = UserUtils.generateHash(8); if (emailService.addVerificationCode(visitor.getUid(), request.getParameter("account"), authCode)) { Session session = Session.getDefaultInstance(System.getProperties()); |