diff --git a/daemawiki-service/src/main/java/org/daemawiki/domain/mail/usecase/service/UserMailSendService.java b/daemawiki-service/src/main/java/org/daemawiki/domain/mail/usecase/service/UserMailSendService.java index 9617dd26..85d84799 100644 --- a/daemawiki-service/src/main/java/org/daemawiki/domain/mail/usecase/service/UserMailSendService.java +++ b/daemawiki-service/src/main/java/org/daemawiki/domain/mail/usecase/service/UserMailSendService.java @@ -103,9 +103,15 @@ private String getMailTemplate(String key) { private String getRandomCode() { SecureRandom secureRandom = new SecureRandom(); + byte[] seed = new byte[32]; + secureRandom.nextBytes(seed); + secureRandom.setSeed(seed); byte[] randomBytes = new byte[4]; secureRandom.nextBytes(randomBytes); - return Base64.getUrlEncoder().withoutPadding().encodeToString(randomBytes); + + return Base64.getUrlEncoder() + .withoutPadding() + .encodeToString(randomBytes); } }