Skip to content

Commit c2b14db

Browse files
committed
refactor: remove redundant initialization of auth in VerifyToken function
1 parent 2b77ed5 commit c2b14db

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

middleware.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,12 @@ func VerifyToken(cfg Options) func(next http.Handler) http.Handler {
6969
jwtOptions := []jwt.ValidateOption{
7070
jwt.WithAcceptableSkew(2 * time.Minute),
7171
}
72+
auth := NewAuth(cfg.JWTSecret)
7273

7374
return func(next http.Handler) http.Handler {
7475
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
7576
ctx := r.Context()
7677

77-
auth := NewAuth(cfg.JWTSecret)
78-
7978
if cfg.ProjectStore != nil {
8079
projectID, err := findProjectClaim(r)
8180
if err != nil {

0 commit comments

Comments
 (0)