|
@@ -4,6 +4,7 @@ import (
|
|
|
"context"
|
|
|
"encoding/json"
|
|
|
"errors"
|
|
|
+ "fmt"
|
|
|
"github.com/gogf/gf/encoding/gjson"
|
|
|
"sparrow/pkg/productconfig"
|
|
|
"sparrow/pkg/rpcs"
|
|
@@ -355,14 +356,14 @@ func AppAuth(req *http.Request, r render.Render) {
|
|
|
}
|
|
|
|
|
|
app := &models.Application{}
|
|
|
-
|
|
|
+ fmt.Println("+++++++++++++++++++++++++")
|
|
|
err = server.RPCCallByName(nil, rpcs.RegistryServerName, "Registry.FindApplicationByAppKey", ruleReq, app)
|
|
|
if err != nil {
|
|
|
|
|
|
r.JSON(http.StatusOK, renderError(ErrWrongSecret, errors.New("invalid secret key")))
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+ fmt.Println("---------")
|
|
|
if app.SecretKey != ruleReq.Secretkey {
|
|
|
// device secret is wrong.
|
|
|
r.JSON(http.StatusOK, renderError(ErrWrongSecret, errors.New("wrong application secret")))
|