Add local jwt (#1047)

This commit is contained in:
link 2023-05-05 10:37:23 +08:00 committed by GitHub
parent 705bf1facb
commit 08c500c434
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,7 +41,7 @@ func InitV1Router() *gin.Engine {
r.GET("/v1/recover/:type", v1.GetRecoverStorage) r.GET("/v1/recover/:type", v1.GetRecoverStorage)
v1Group := r.Group("/v1") v1Group := r.Group("/v1")
v1Group.Use(jwt.JWT( v1Group.Use(jwt.ExceptLocalhost(
func() (*ecdsa.PublicKey, error) { func() (*ecdsa.PublicKey, error) {
return external.GetPublicKey(config.CommonInfo.RuntimePath) return external.GetPublicKey(config.CommonInfo.RuntimePath)
}, },