diff --git a/api/middleware.go b/api/middleware.go index 3207395..48b7d45 100644 --- a/api/middleware.go +++ b/api/middleware.go @@ -25,6 +25,11 @@ const WEBHOOK_CONTEXT_KEY = "webhook" const AuthCookieName = "auth-token" +type standardClaims struct { + Issuer any `json:"iss,omitempty"` + jwt.StandardClaims +} + func findAuthToken(r *http.Request) string { authHeader := parseAuthTokenHeader(r.Header) @@ -129,7 +134,7 @@ func githubRestVerifyMiddleware(db *gorm.DB) mux.MiddlewareFunc { publicKey := &privateKey.PublicKey - parseToken, err = jwt.ParseWithClaims(token, &jwt.StandardClaims{}, func(token *jwt.Token) (interface{}, error) { + parseToken, err = jwt.ParseWithClaims(token, &standardClaims{}, func(token *jwt.Token) (interface{}, error) { if _, ok := token.Method.(*jwt.SigningMethodRSA); !ok { return nil, fmt.Errorf("unexpected signing method: %v", token.Header["alg"]) }