From 61871201d9987a195853411f6eb50595de00c0a0 Mon Sep 17 00:00:00 2001 From: darius Date: Mon, 20 May 2024 00:20:50 +0200 Subject: [PATCH] login fix --- main.go | 2 +- web/handlers/pageTemplates.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 637c733..8b09d82 100644 --- a/main.go +++ b/main.go @@ -27,7 +27,7 @@ func main() { go http.ListenAndServe(":4000", cors.AllowAll().Handler(webMux)) c := cors.New(cors.Options{ - AllowedOrigins: []string{"*"}, + AllowedOrigins: []string{"http://localhost:4000", "https://*.dariusklein.nl"}, AllowedMethods: []string{ http.MethodHead, http.MethodGet, diff --git a/web/handlers/pageTemplates.go b/web/handlers/pageTemplates.go index 029ba42..b77705e 100644 --- a/web/handlers/pageTemplates.go +++ b/web/handlers/pageTemplates.go @@ -13,6 +13,7 @@ func Page(title string, body g.Node) g.Node { Title: title, Language: "en", Head: []g.Node{ + Meta(Name("htmx-config"), Content("{\"withCredentials\":\"true\"}")), Script(Src("https://cdn.tailwindcss.com?plugins=typography")), Script(Src("https://unpkg.com/htmx.org")), Link(Rel("icon"), Type("image/x-icon"), Href("assets/images/favicon.ico")),