mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-08-30 17:13:08 +08:00
fix: nil pointer panic when auth decode body failed
This commit is contained in:
@@ -73,6 +73,10 @@ func authenticateTokensV2(ctx context.Context, w http.ResponseWriter, r *http.Re
|
||||
|
||||
func authenticateTokensV3(ctx context.Context, w http.ResponseWriter, r *http.Request) {
|
||||
_, _, body := appsrv.FetchEnv(ctx, w, r)
|
||||
if body == nil {
|
||||
httperrors.InvalidInputError(w, "fail to decode request body")
|
||||
return
|
||||
}
|
||||
input := mcclient.SAuthenticationInputV3{}
|
||||
err := body.Unmarshal(&input)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user