mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-15 18:50:41 -07:00
Fix for unix time flapper
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -410,8 +410,9 @@ func TestJWTAccountExpiresAfterConnect(t *testing.T) {
|
||||
akp, _ := nkeys.CreateAccount()
|
||||
apub, _ := akp.PublicKey()
|
||||
nac := jwt.NewAccountClaims(apub)
|
||||
nac.IssuedAt = time.Now().Unix()
|
||||
nac.Expires = time.Now().Add(time.Second).Unix()
|
||||
now := time.Now()
|
||||
nac.IssuedAt = now.Add(-10 * time.Second).Unix()
|
||||
nac.Expires = now.Round(time.Second).Add(time.Second).Unix()
|
||||
ajwt, err := nac.Encode(okp)
|
||||
if err != nil {
|
||||
t.Fatalf("Error generating account JWT: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user