Skip to content

Commit

Permalink
fix: fix subscription's expire_at
Browse files Browse the repository at this point in the history
  • Loading branch information
zensh committed Oct 22, 2023
1 parent 9e8b177 commit d1e7438
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/api/payment.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (a *Payment) GetCode(ctx *gear.Context) error {
GID: input.GID,
UID: sess.UserID,
CID: input.CID,
Duration: 3600 * 24 * 365 * 3,
Duration: 3600 * 24 * 365 * 3, // seconds
}
output := &PaymentCodeOutput{
Kind: code.Kind,
Expand Down
2 changes: 1 addition & 1 deletion src/api/publication.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ func (a *Publication) Get(ctx *gear.Context) error {
return err
}

now := time.Now().Unix() * 1000
now := time.Now().Unix()
subscription_in := &util.ZeroID
subtoken, err := util.DecodeMac0[SubscriptionToken](a.blls.MACer, input.SubToken, []byte("SubscriptionToken"))
if err == nil && subtoken.ExpireAt >= now {
Expand Down

0 comments on commit d1e7438

Please sign in to comment.