Merge pull request #15 from rotblauer/fix-tokenauth-refreshexpiry

auth/jwt: RefreshJWT constructor should use JwtRefreshExpiry value
This commit is contained in:
dhax 2021-03-08 15:49:21 +01:00 committed by GitHub
commit c3809c7cab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -61,7 +61,7 @@ func (a *TokenAuth) CreateJWT(c AppClaims) (string, error) {
// CreateRefreshJWT returns a refresh token for provided token Claims.
func (a *TokenAuth) CreateRefreshJWT(c RefreshClaims) (string, error) {
c.IssuedAt = time.Now().Unix()
c.ExpiresAt = time.Now().Add(a.JwtExpiry).Unix()
c.ExpiresAt = time.Now().Add(a.JwtRefreshExpiry).Unix()
_, tokenString, err := a.JwtAuth.Encode(c)
return tokenString, err
}