From 464fff7180d3a5d5c37d9f745b59f7229e257379 Mon Sep 17 00:00:00 2001 From: Nguyen Marc Date: Wed, 24 Jan 2024 02:23:03 +0100 Subject: [PATCH] fix(jwt): fix receiver name --- jwt/jwt.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jwt/jwt.go b/jwt/jwt.go index 3008b43..69886ff 100644 --- a/jwt/jwt.go +++ b/jwt/jwt.go @@ -117,7 +117,7 @@ func (s Secret) VerifyToken(tokenString string) (*Claims, error) { } // Middleware is a middleware that inject the JWT in the context for HTTP servers. -func (jwt Secret) Middleware(next http.Handler) http.Handler { +func (s Secret) Middleware(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { // Get the JWT token from the request header cookie, err := r.Cookie(TokenCookieKey) @@ -127,7 +127,7 @@ func (jwt Secret) Middleware(next http.Handler) http.Handler { } // Verify the JWT token - claims, err := jwt.VerifyToken(cookie.Value) + claims, err := s.VerifyToken(cookie.Value) if err != nil { next.ServeHTTP(w, r) return