auth/jwt: RefreshJWT constructor should use JwtRefreshExpiry value
This fixes a bug where the RefreshJWT token used the JWTExpiry instead of the refresh one.
This commit is contained in:
parent
21175bda62
commit
1456a42a89
1 changed files with 1 additions and 1 deletions
|
|
@ -61,7 +61,7 @@ func (a *TokenAuth) CreateJWT(c AppClaims) (string, error) {
|
||||||
// CreateRefreshJWT returns a refresh token for provided token Claims.
|
// CreateRefreshJWT returns a refresh token for provided token Claims.
|
||||||
func (a *TokenAuth) CreateRefreshJWT(c RefreshClaims) (string, error) {
|
func (a *TokenAuth) CreateRefreshJWT(c RefreshClaims) (string, error) {
|
||||||
c.IssuedAt = time.Now().Unix()
|
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)
|
_, tokenString, err := a.JwtAuth.Encode(c)
|
||||||
return tokenString, err
|
return tokenString, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue