diff --git a/cmd/motr/main.go b/cmd/motr/main.go index e87058e14..fa8936612 100644 --- a/cmd/motr/main.go +++ b/cmd/motr/main.go @@ -8,8 +8,7 @@ import ( "syscall/js" "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/cmd/motr/internal" - "github.com/onsonr/sonr/pkg/common/controller" + "github.com/onsonr/sonr/pkg/common/dids" "github.com/onsonr/sonr/pkg/vault" "github.com/onsonr/sonr/pkg/vault/types" ) @@ -48,8 +47,8 @@ func main() { js.Global().Set("processConfig", js.FuncOf(processConfig)) e := echo.New() - e.Use(internal.WasmContextMiddleware) - e.Use(controller.Middleware(nil)) + e.Use(vault.WasmContextMiddleware) + e.Use(dids.Middleware(nil)) vault.RegisterRoutes(e, config) - internal.ServeFetch(e) + vault.ServeFetch(e) } diff --git a/pkg/blocks/forms/create_profile.templ b/pkg/blocks/forms/create_profile.templ index 764ab1a00..4747b988e 100644 --- a/pkg/blocks/forms/create_profile.templ +++ b/pkg/blocks/forms/create_profile.templ @@ -2,8 +2,6 @@ package forms import ( "fmt" - "strconv" - "errors" "github.com/onsonr/sonr/pkg/blocks/layout" ) @@ -17,30 +15,6 @@ func (d CreateProfileData) IsHumanLabel() string { return fmt.Sprintf("What is %d + %d?", d.FirstNumber, d.LastNumber) } -func ValidateCreateProfileForm(formData map[string][]string) error { - // Validate ishuman slider - ishumanValues := formData["is_human"] - if len(ishumanValues) == 0 { - return errors.New("human verification is required") - } - - ishumanSum, err := strconv.Atoi(ishumanValues[0]) - if err != nil { - return errors.New("invalid human verification value") - } - - // Get the expected sum from the form data - firstNum, _ := strconv.Atoi(formData["first_number"][0]) - lastNum, _ := strconv.Atoi(formData["last_number"][0]) - expectedSum := firstNum + lastNum - - if ishumanSum != expectedSum { - return errors.New("incorrect sum for human verification") - } - - return nil -} - // ProfileForm is a standard form styled like a card templ CreateProfile(action string, method string, data CreateProfileData) {