Explorar el Código

test: DeviceSecret

lijian hace 2 años
padre
commit
e5f21a3cf6
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  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.")))