fix: use []byte for jwt key
This commit is contained in:
parent
85a3c3ef10
commit
79a716cf55
1 changed files with 2 additions and 2 deletions
|
|
@ -53,7 +53,7 @@ func (s Server) generateTokens(userID string) (accessToken string, refreshToken
|
|||
"exp": time.Now().Add(15 * time.Minute).Unix(),
|
||||
}
|
||||
at := jwt.NewWithClaims(jwt.SigningMethodHS256, accessClaims)
|
||||
accessToken, err = at.SignedString(s.JwtPrivateKey)
|
||||
accessToken, err = at.SignedString([]byte(s.JwtPrivateKey))
|
||||
if err != nil {
|
||||
return "", "", "", err
|
||||
}
|
||||
|
|
@ -63,7 +63,7 @@ func (s Server) generateTokens(userID string) (accessToken string, refreshToken
|
|||
"exp": time.Now().Add(7 * 24 * time.Hour).Unix(),
|
||||
}
|
||||
rt := jwt.NewWithClaims(jwt.SigningMethodHS256, refreshClaims)
|
||||
refreshToken, err = rt.SignedString(s.JwtPrivateKey)
|
||||
refreshToken, err = rt.SignedString([]byte(s.JwtPrivateKey))
|
||||
if err != nil {
|
||||
return "", "", "", err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue