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")