Selaa lähdekoodia

test: DeviceSecret

lijian 2 vuotta sitten
vanhempi
commit
e5f21a3cf6
1 muutettua tiedostoa jossa 2 lisäystä ja 1 poistoa
  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.")))