diff --git a/internal/gateway/handlers/register/data.go b/internal/gateway/handlers/register/data.go index 0063025e5..b0109d9c0 100644 --- a/internal/gateway/handlers/register/data.go +++ b/internal/gateway/handlers/register/data.go @@ -6,6 +6,7 @@ import ( "net/http" "github.com/labstack/echo/v4" + "golang.org/x/exp/rand" ) // Define the credential structure matching our frontend data @@ -76,3 +77,10 @@ func extractCredentialDescriptor(jsonString string) (*Credential, error) { ) return cred, nil } + +func randomCreateProfileData() CreateProfileData { + return CreateProfileData{ + FirstNumber: rand.Intn(5) + 1, + LastNumber: rand.Intn(4) + 1, + } +} diff --git a/internal/gateway/handlers/register/handlers.go b/internal/gateway/handlers/register/handlers.go index 26c5b9563..c04dff73f 100644 --- a/internal/gateway/handlers/register/handlers.go +++ b/internal/gateway/handlers/register/handlers.go @@ -8,11 +8,11 @@ import ( "github.com/labstack/echo/v4" "github.com/onsonr/sonr/crypto/mpc" "github.com/onsonr/sonr/pkg/common/response" - "golang.org/x/exp/rand" ) func HandleCreateProfile(c echo.Context) error { - return response.TemplEcho(c, ProfileFormView(randomCreateProfileData())) + d := randomCreateProfileData() + return response.TemplEcho(c, ProfileFormView(d)) } func HandlePasskeyStart(c echo.Context) error { @@ -47,10 +47,3 @@ func HandlePasskeyFinish(c echo.Context) error { } return response.TemplEcho(c, LoadingVaultView()) } - -func randomCreateProfileData() CreateProfileData { - return CreateProfileData{ - FirstNumber: rand.Intn(5) + 1, - LastNumber: rand.Intn(4) + 1, - } -} diff --git a/internal/gateway/handlers/register/views.templ b/internal/gateway/handlers/register/views.templ index 97da3831b..ad9a9b9ce 100644 --- a/internal/gateway/handlers/register/views.templ +++ b/internal/gateway/handlers/register/views.templ @@ -6,7 +6,7 @@ import ( ) templ ProfileFormView(data CreateProfileData) { - @layout.Root("Create Profile | Sonr.ID") { + @layout.Root("New Profile | Sonr.ID") { @layout.Container() { @text.Header("Basic Info", "Tell us a little about yourself.") @formCreateProfile("/register/start", "POST", data) diff --git a/internal/gateway/handlers/register/views_templ.go b/internal/gateway/handlers/register/views_templ.go index 955e0c7a6..8012f3e57 100644 --- a/internal/gateway/handlers/register/views_templ.go +++ b/internal/gateway/handlers/register/views_templ.go @@ -78,7 +78,7 @@ func ProfileFormView(data CreateProfileData) templ.Component { } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = layout.Root("Create Profile | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = layout.Root("New Profile | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/pkg/common/styles/layout/container.templ b/pkg/common/styles/layout/container.templ index 98ddf9f05..a3f4c9413 100644 --- a/pkg/common/styles/layout/container.templ +++ b/pkg/common/styles/layout/container.templ @@ -10,7 +10,7 @@ templ Columns() { templ Container() {