File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
core/main/java/com/codingchili/core/security Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -17,8 +17,7 @@ public class Token implements Serializable {
1717 private Map <String , Object > properties = new HashMap <>();
1818 private String domain = UUID .randomUUID ().toString ();
1919 private String key = "" ;
20- private long expiry = Instant .now ().getEpochSecond () +
21- Configurations .security ().getTokenttl ();
20+ private Long expiry ;
2221
2322 /**
2423 * Creates a new empty unverified token.
@@ -55,6 +54,10 @@ public Token setKey(String key) {
5554 * @return the time of expiry in epoch seconds.
5655 */
5756 public long getExpiry () {
57+ if (expiry == null ) {
58+ expiry = Instant .now ().getEpochSecond () +
59+ Configurations .security ().getTokenttl ();
60+ }
5861 return expiry ;
5962 }
6063
You can’t perform that action at this time.
0 commit comments