email token duplication check

This commit is contained in:
geek 2018-05-10 19:24:06 +09:00
parent 1267ad22bc
commit 77e018f99a

View File

@ -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;
}