Skip to content

Commit

Permalink
refactor: move err declaration to the top of a file
Browse files Browse the repository at this point in the history
  • Loading branch information
olexsmir committed Sep 12, 2024
1 parent 58d06cb commit eb76c32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/jwtutil/jwtutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"github.com/golang-jwt/jwt/v5"
)

var ErrUnexpectedSigningMethod = errors.New("unexpected signing method")

type JWTTokenizer interface {
// AccessToken generates a new access token with the given payload
AccessToken(pl Payload) (string, error)
Expand Down Expand Up @@ -54,8 +56,6 @@ func (j *JWTUtil) RefreshToken() (string, error) {
return hex.EncodeToString(b), nil
}

var ErrUnexpectedSigningMethod = errors.New("unexpected signing method")

func (j *JWTUtil) Parse(token string) (Payload, error) {
var claims jwt.RegisteredClaims
_, err := jwt.ParseWithClaims(token, &claims, func(t *jwt.Token) (interface{}, error) {
Expand Down

0 comments on commit eb76c32

Please sign in to comment.