Procházet zdrojové kódy

test: DeviceSecret

lijian před 2 roky
rodič
revize
e5f21a3cf6
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  1. 2 1
      services/httpaccess/actions.go

+ 2 - 1
services/httpaccess/actions.go

@@ -4,6 +4,7 @@ import (
 	"context"
 	"encoding/hex"
 	"errors"
+	"fmt"
 	"math/rand"
 	"net/http"
 	"sparrow/pkg/models"
@@ -94,7 +95,7 @@ func AuthDevice(args DeviceAuthArgs, r render.Render) {
 		r.JSON(http.StatusOK, renderError(ErrDeviceNotFound, err))
 		return
 	}
-
+	fmt.Printf(fmt.Sprintf("%s, %s", device.DeviceSecret, args.DeviceSecret))
 	if device.DeviceSecret != args.DeviceSecret {
 		// device secret is wrong.
 		r.JSON(http.StatusOK, renderError(ErrWrongSecret, errors.New("wrong device secret.")))