refactor: consolidate authentication and DID handling logic
This commit is contained in:
1 parent
ce3d073abd
commit
f8d362352d
23 files changed
+144
-217
No files matched your search
@@ -3,8 +3,8 @@ package handlers
|
||||
import (
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/onsonr/sonr/pkg/common/response"
|
||||
"github.com/onsonr/sonr/pkg/gateway/internal/pages/index"
|
||||
"github.com/onsonr/sonr/pkg/gateway/internal/session"
|
||||
"github.com/onsonr/sonr/pkg/gateway/pages/index"
|
||||
)
|
||||
|
||||
func HandleIndex(c echo.Context) error {
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
"github.com/onsonr/sonr/pkg/blocks/forms"
|
||||
"github.com/onsonr/sonr/pkg/common/response"
|
||||
"github.com/onsonr/sonr/pkg/gateway/internal/database"
|
||||
"github.com/onsonr/sonr/pkg/gateway/internal/pages/register"
|
||||
"github.com/onsonr/sonr/pkg/gateway/pages/register"
|
||||
)
|
||||
|
||||
func HandleRegisterView(c echo.Context) error {
|
||||
@@ -24,16 +24,6 @@ func HandleRegisterView(c echo.Context) error {
|
||||
}
|
||||
|
||||
func HandleRegisterStart(c echo.Context) error {
|
||||
// Validate the form submission
|
||||
formData := make(map[string][]string)
|
||||
for key, values := range c.Request().Form {
|
||||
formData[key] = values
|
||||
}
|
||||
|
||||
if err := forms.ValidateCreateProfileForm(formData); err != nil {
|
||||
return echo.NewHTTPError(http.StatusBadRequest, err.Error())
|
||||
}
|
||||
|
||||
challenge, _ := protocol.CreateChallenge()
|
||||
handle := c.FormValue("handle")
|
||||
firstName := c.FormValue("first_name")
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user