From 763a38e157c5eaa200697a9c02bc24ae3ea881d7 Mon Sep 17 00:00:00 2001 From: Ivan Titov Date: Sat, 15 Feb 2025 13:12:16 +0300 Subject: [PATCH] =?UTF-8?q?[+]=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20cors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/main.go b/cmd/main.go index e75157c..f94f27d 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -5,6 +5,7 @@ import ( "jwt_service/internal/routes" "github.com/gofiber/fiber/v2" + "github.com/gofiber/fiber/v2/middleware/cors" ) func main() { @@ -12,6 +13,11 @@ func main() { app := fiber.New() + app.Use(cors.New(cors.Config{ + AllowCredentials: true, + AllowOrigins: "http://127.0.0.1", //Very important while using a HTTPonly Cookie, frontend can easily get and return back the cookie. + })) + routes.Setup(app) app.Listen(":8000")