Skip to content

Commit

Permalink
Merge pull request #285 from abby-knitta/fix/consistent-timestamp-for…
Browse files Browse the repository at this point in the history
…-issued-at-and-expired-at

fix(appstore): Use consistent timestamp for issued_at and expired_at
  • Loading branch information
takecy authored Jun 3, 2024
2 parents a5f934d + 78d0163 commit 4c74f3f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions appstore/api/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,12 @@ func (t *Token) Generate() error {
}
t.AuthKey = key

issuedAt := time.Now().Unix()
now := time.Now()
issuedAt := now.Unix()
if t.IssuedAtFunc != nil {
issuedAt = t.IssuedAtFunc()
}
expiredAt := time.Now().Add(time.Duration(1) * time.Hour).Unix()
expiredAt := now.Add(time.Duration(1) * time.Hour).Unix()
if t.ExpiredAtFunc != nil {
expiredAt = t.ExpiredAtFunc()
}
Expand Down

0 comments on commit 4c74f3f

Please sign in to comment.