diff --git a/Makefile b/Makefile index 2481d96..c7f2489 100644 --- a/Makefile +++ b/Makefile @@ -83,6 +83,9 @@ test: ## ๐Ÿงช run tests with coverage lint: tools ## ๐Ÿ“‘ lint rules checks $(REVIVE) -formatter stylish github.com/$(ORGANIZATION)/$(PROJECT_NAME) pocketbase/... +fmt: tools ## ๐Ÿ—ฟ format rules checks + $(GOFUMPT) -l -w pocketbase *.go + tidy: $(GOMOD_FILES) @$(GOMOD) tidy diff --git a/pocketbase/webauthn/webauthn.go b/pocketbase/webauthn/webauthn.go index 509d41d..5f66001 100644 --- a/pocketbase/webauthn/webauthn.go +++ b/pocketbase/webauthn/webauthn.go @@ -1,10 +1,9 @@ package webauthn import ( + "bytes" "encoding/json" "errors" - - "bytes" "fmt" "io" "log" @@ -26,7 +25,6 @@ type User struct { } func NewUser(app *pocketbase.PocketBase, m *models.Record) *User { - user := &User{ model: m, app: app, @@ -212,13 +210,11 @@ func Register(app *pocketbase.PocketBase) error { options, sessionData, err := w.BeginRegistration( user, ) - if err != nil { return c.JSON(http.StatusInternalServerError, err.Error()) } err = storeSessionData(app, userRecord, sessionData) - if err != nil { return c.JSON(http.StatusInternalServerError, err.Error()) } @@ -316,7 +312,6 @@ func Register(app *pocketbase.PocketBase) error { } err = storeSessionData(app, userRecord, sessionData) - if err != nil { return c.JSON(http.StatusInternalServerError, err.Error()) }