cookie ready

This commit is contained in:
2026-05-13 22:34:11 +02:00
parent 8c4e664ca8
commit 1b53c1c199
16 changed files with 798 additions and 146 deletions
+8 -1
View File
@@ -71,7 +71,13 @@ func run() error {
customerService := pscustomer.NewService(prestaDB, cfg.PrestaShopTablePrefix)
cartService := pscart.NewService(prestaDB, cfg.PrestaShopTablePrefix)
routeService := psroutes.NewService(prestaDB, cfg.PrestaShopTablePrefix)
sessionService := pssession.NewService(prestaDB, cfg.PrestaShopTablePrefix, cfg.PrestaShopVersion)
sessionService := pssession.NewService(
prestaDB,
cfg.PrestaShopTablePrefix,
cfg.PrestaShopVersion,
cfg.PrestaShopCookieName,
cfg.DomainCookie,
)
productRoute, err := routeService.LoadProductRoute(context.Background())
if err != nil {
return fmt.Errorf("load product route rule: %w", err)
@@ -118,6 +124,7 @@ func run() error {
e.Static("/dist", "web/dist")
e.GET("/healthz", handlers.Healthz())
e.GET("/readyz", handlers.Readyz(appStore, prestaDB, cfg.PrestaShopProxyTarget))
e.Match([]string{http.MethodGet, http.MethodPost}, "/debug/cookie/decode", handlers.DecodeCookie(cookieCodec))
e.GET("/*", func(c echo.Context) error {
productMatch, productOK := productRoute.MatchInfo(c.Request().URL.Path)
categoryMatch, categoryOK := categoryRoute.MatchInfo(c.Request().URL.Path)