feat(identity): register accounts and resend verification mail

This commit is contained in:
shira committed 2026-10-06 23:59:51 +03:00
1 parent 5e202ac972
commit 4436f626a3
55 files changed
+3227 -88

No files matched your search

@@ -4,6 +4,7 @@ import (
"fmt"
"log/slog"
"net/http"
"net/netip"
"github.com/go-chi/chi/v5"
kitmiddleware "github.com/wahrwelt-kit/go-httpkit/httputil/middleware"
@@ -27,7 +28,8 @@ const (
// unknown routes under /api to 404, unsupported methods to 405, and any other
// server error or panic to 500 without exposing its text. Operation errors go
// through apiHandler.NewError. security decides every operation that requires
// a session; the generated server answers its rejection, and a request
// a session; trustedProxies are the reverse proxies whose X-Forwarded-For
// is believed; the generated server answers its rejection, and a request
// without the session cookie, with 401 unauthenticated through NewError.
func NewRouter(
health *v1.HealthHandler,
@@ -36,6 +38,7 @@ func NewRouter(
problems *problem.Responder,
collector httpmiddleware.RequestMetrics,
logger *slog.Logger,
trustedProxies []netip.Prefix,
) (http.Handler, error) {
apiServer, err := apiadapter.NewServer(
apiHandler,
@@ -55,6 +58,9 @@ func NewRouter(
// same route template as the metrics, never the raw path or query.
resolveRoute := operationRoute(apiServer)
router.Use(kitmiddleware.RequestID())
// The client address is resolved once, through the trusted proxies only,
// for the per-client rate limits of the handlers.
router.Use(httpmiddleware.ClientIP(trustedProxies))
router.Use(httpmiddleware.RequestLog(logger, resolveRoute, healthPath, readinessPath))
router.Use(httpmiddleware.CollectMetrics(collector, resolveRoute))
router.Group(func(operational chi.Router) {