From 833fdf164c8de7b18fbfa8d2c48bd9b8c275a637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Urban?= Date: Tue, 30 Apr 2024 15:12:04 +0200 Subject: [PATCH] fix: print cookies --- backend/internal/handlers/auth.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/internal/handlers/auth.go b/backend/internal/handlers/auth.go index 5e7b8ab..6a37f13 100644 --- a/backend/internal/handlers/auth.go +++ b/backend/internal/handlers/auth.go @@ -87,20 +87,22 @@ func (h *Handler) HandleLogin(w http.ResponseWriter, r *http.Request) { return } + var domain string siteURL, siteUrlErr := h.getRedirectUrl(r, w) if siteUrlErr != nil { // If there was an error getting the redirect URL, use the request's host as the domain log.Println("Site URl could not be determined: " + siteURL) + domain = r.Host } else { // If the redirect URL was obtained successfully, extract the main domain h.setRedirectCookie(siteURL, r, w) var err error + domain, err = extractMainDomain(r.Host) if err != nil { sendJSONError(w, "Invalid Redirect URL", http.StatusBadRequest) return } } - domain, err := extractMainDomain(r.Host) if err != nil { slog.Error("could not extract Main Domain", err) return