From 1272510e6cd89a02ba7e94e22d795d91a22d4bac Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 31 May 2018 20:21:08 +0300 Subject: ugnich random -> commons-lang3 RandomStringUtils --- juick-www/src/main/java/com/juick/www/controllers/Settings.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'juick-www/src/main/java/com/juick/www/controllers') 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 7f6cce44..f9527423 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 @@ -21,6 +21,7 @@ import com.juick.server.helpers.NotifyOpts; import com.juick.server.helpers.UserInfo; import com.juick.server.util.*; import com.juick.service.*; +import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -186,7 +187,7 @@ public class Settings { break; case "email-add": if (!emailService.verifyAddressByCode(visitor.getUid(), request.getParameter("account"))) { - String authCode = HashUtils.generateHash(8); + String authCode = RandomStringUtils.randomAlphanumeric(8).toUpperCase(); if (emailService.addVerificationCode(visitor.getUid(), request.getParameter("account"), authCode)) { Session session = Session.getDefaultInstance(System.getProperties()); try { -- cgit v1.2.3