node: set JWT expiry to 60 seconds (#25416)

* node: set JWT expiry to 60 seconds

* node: rename var
This commit is contained in:
Marius van der Wijden authored and GitHub committed 2022-07-28 09:30:50 +03:00
1 parent c02b0488fb
commit f26b63089a
2 files changed
+6 -4

No files matched your search

+2 -2
View File
@@ -356,11 +356,11 @@ func TestJWT(t *testing.T) {
expFail := []func() string{
// future
func() string {
return fmt.Sprintf("Bearer %v", issueToken(secret, nil, testClaim{"iat": time.Now().Unix() + 6}))
return fmt.Sprintf("Bearer %v", issueToken(secret, nil, testClaim{"iat": time.Now().Unix() + int64(jwtExpiryTimeout.Seconds()) + 1}))
},
// stale
func() string {
return fmt.Sprintf("Bearer %v", issueToken(secret, nil, testClaim{"iat": time.Now().Unix() - 6}))
return fmt.Sprintf("Bearer %v", issueToken(secret, nil, testClaim{"iat": time.Now().Unix() - int64(jwtExpiryTimeout.Seconds()) - 1}))
},
// wrong algo
func() string {