feat: complete device onboarding and mobile binding workflows
ci / verify (push) Canceled after 0s

This commit is contained in:
Codex Local
2026-09-12 08:57:29 +08:00
parent 7846f30d0b
commit 98fb2965d0
116 changed files with 15669 additions and 64 deletions
@@ -0,0 +1,23 @@
package httpapi
import (
"data-terminal-cloud/internal/onboarding"
"net/http"
"strings"
)
func onboardingCustomerAuth(service *onboarding.Service, bearer, next http.Handler) http.Handler {
if service == nil {
return bearer
}
cookie := service.CustomerAuth(next)
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
path := r.URL.Path
allowed := path == "/api/v1/me" || path == "/api/v1/households" || strings.HasPrefix(path, "/api/v1/households/") || strings.HasPrefix(path, "/api/v1/subjects/") || strings.HasPrefix(path, "/api/v1/devices/")
if r.Header.Get("Authorization") == "" && allowed {
cookie.ServeHTTP(w, r)
return
}
bearer.ServeHTTP(w, r)
})
}