Skip to content

Commit f964c98

Browse files
committed
Changed documentation of verify methods similar to golang-jwt#83
1 parent 254c2e0 commit f964c98

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

claims.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ func (c *StandardClaims) VerifyAudience(cmp string, req bool) bool {
170170
return verifyAud([]string{c.Audience}, cmp, req)
171171
}
172172

173-
// VerifyExpiresAt compares the exp claim against cmp.
174-
// If required is false, this method will return true if the value matches or is unset
173+
// VerifyExpiresAt compares the exp claim against cmp (cmp <= exp).
174+
// If req is false, it will return true, if exp is unset.
175175
func (c *StandardClaims) VerifyExpiresAt(cmp int64, req bool) bool {
176176
if c.ExpiresAt == 0 {
177177
return verifyExp(nil, time.Unix(cmp, 0), req)
@@ -181,8 +181,8 @@ func (c *StandardClaims) VerifyExpiresAt(cmp int64, req bool) bool {
181181
return verifyExp(&t, time.Unix(cmp, 0), req)
182182
}
183183

184-
// VerifyIssuedAt compares the iat claim against cmp.
185-
// If required is false, this method will return true if the value matches or is unset
184+
// VerifyIssuedAt compares the iat claim against cmp (cmp >= iat).
185+
// If req is false, it will return true, if iat is unset.
186186
func (c *StandardClaims) VerifyIssuedAt(cmp int64, req bool) bool {
187187
if c.IssuedAt == 0 {
188188
return verifyIat(nil, time.Unix(cmp, 0), req)
@@ -192,8 +192,8 @@ func (c *StandardClaims) VerifyIssuedAt(cmp int64, req bool) bool {
192192
return verifyIat(&t, time.Unix(cmp, 0), req)
193193
}
194194

195-
// VerifyNotBefore compares the nbf claim against cmp.
196-
// If required is false, this method will return true if the value matches or is unset
195+
// VerifyNotBefore compares the nbf claim against cmp (cmp >= nbf).
196+
// If req is false, it will return true, if nbf is unset.
197197
func (c *StandardClaims) VerifyNotBefore(cmp int64, req bool) bool {
198198
if c.NotBefore == 0 {
199199
return verifyNbf(nil, time.Unix(cmp, 0), req)

0 commit comments

Comments
 (0)