fix: issues discovered by invocation validation tests

This commit is contained in:
Steve Moyer
2024-11-13 12:40:25 -05:00
parent 64b989452f
commit fc4c8f2de1
4 changed files with 7 additions and 5 deletions

View File

@@ -162,7 +162,7 @@ func (t *Token) IsValidNow() bool {
// IsValidNow verifies that the token can be used at the given time, based on expiration or "not before" fields.
// This does NOT do any other kind of verifications.
func (t *Token) IsValidAt(ti time.Time) bool {
if t.expiration == nil && ti.After(*t.expiration) {
if t.expiration != nil && ti.After(*t.expiration) {
return false
}
if t.notBefore != nil && ti.Before(*t.notBefore) {