From 77e018f99a3d27e15d5eb36924f5ef4c5cedf05b Mon Sep 17 00:00:00 2001 From: geek Date: Thu, 10 May 2018 19:24:06 +0900 Subject: [PATCH] email token duplication check --- .../module/email/service/EmailAuthService.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/loafle/overflow/central/module/email/service/EmailAuthService.java b/src/main/java/com/loafle/overflow/central/module/email/service/EmailAuthService.java index 2b300ef..91c7578 100644 --- a/src/main/java/com/loafle/overflow/central/module/email/service/EmailAuthService.java +++ b/src/main/java/com/loafle/overflow/central/module/email/service/EmailAuthService.java @@ -68,7 +68,9 @@ public class EmailAuthService { boolean res = this.isValidateTime(auth); if (!res) { - throw new OverflowException("The authentication expiration time has passed.", new Throwable()); + throw new OverflowException( + "The authentication expiration time has expired, or the token has been verified.", + new Throwable()); } auth.setAuthConfirmDate(new Date()); @@ -97,7 +99,9 @@ public class EmailAuthService { boolean res = this.isValidateTime(auth); if (!res) { - throw new OverflowException("The authentication expiration time has passed.", new Throwable()); + throw new OverflowException( + "The authentication expiration time has expired, or the token has been verified.", + new Throwable()); } auth.setAuthConfirmDate(new Date()); @@ -154,6 +158,10 @@ public class EmailAuthService { return false; } + if (null != auth.getAuthConfirmDate()) { + return false; + } + return true; }