signup: Fix validation code expiring check bug
@054578405fda135569b3fa2905ea2dad15f8ee28
--- app/models/UserVerification.java
+++ app/models/UserVerification.java
... | ... | @@ -33,7 +33,7 @@ |
33 | 33 |
|
34 | 34 |
public Long timestamp; |
35 | 35 |
|
36 |
- public static UserVerification newVerification(User user) { |
|
36 |
+ public static synchronized UserVerification newVerification(User user) { |
|
37 | 37 |
UserVerification v = new UserVerification(); |
38 | 38 |
v.user = user; |
39 | 39 |
v.loginId = user.loginId; |
... | ... | @@ -63,10 +63,11 @@ |
63 | 63 |
} |
64 | 64 |
|
65 | 65 |
public boolean isValidDate(){ |
66 |
- if( this.timestamp + 60*60*24 > new Date().getTime()) { |
|
66 |
+ if( this.timestamp + 60*60*24*1000 > new Date().getTime()) { |
|
67 | 67 |
return true; |
68 | 68 |
} else { |
69 | 69 |
this.delete(); |
70 |
+ play.Logger.error("Email validation is expired: " + this.loginId + ":" + this.verificationCode); |
|
70 | 71 |
return false; |
71 | 72 |
} |
72 | 73 |
} |
... | ... | @@ -74,4 +75,15 @@ |
74 | 75 |
public void invalidate(){ |
75 | 76 |
this.delete(); |
76 | 77 |
} |
78 |
+ |
|
79 |
+ @Override |
|
80 |
+ public String toString() { |
|
81 |
+ return "UserVerification{" + |
|
82 |
+ "id=" + id + |
|
83 |
+ ", user=" + user + |
|
84 |
+ ", loginId='" + loginId + '\'' + |
|
85 |
+ ", verificationCode='" + verificationCode + '\'' + |
|
86 |
+ ", timestamp=" + timestamp + |
|
87 |
+ '}'; |
|
88 |
+ } |
|
77 | 89 |
} |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?