Skip to content

Commit

Permalink
fix(jwt): fix receiver name
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkness4 committed Jan 24, 2024
1 parent 645a37a commit 464fff7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jwt/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 464fff7

Please sign in to comment.