From caf0b24b0c39fc8e5832542a20911eb84db4b000 Mon Sep 17 00:00:00 2001 From: Lakhan Samani Date: Wed, 21 Jul 2021 21:27:12 +0530 Subject: [PATCH] add log to debug cookie --- server/utils/cookie.go | 4 ++++ server/utils/urls.go | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/server/utils/cookie.go b/server/utils/cookie.go index 0e83b23..281577e 100644 --- a/server/utils/cookie.go +++ b/server/utils/cookie.go @@ -1,6 +1,8 @@ package utils import ( + "log" + "github.com/gin-gonic/gin" "github.com/yauthdev/yauth/server/constants" ) @@ -13,6 +15,8 @@ func SetCookie(gc *gin.Context, token string) { secure = false } + log.Println("-> is cookie secure", secure) + gc.SetCookie(constants.COOKIE_NAME, token, 3600, "/", GetFrontendHost(), secure, httpOnly) } diff --git a/server/utils/urls.go b/server/utils/urls.go index 126b617..8a9cf0d 100644 --- a/server/utils/urls.go +++ b/server/utils/urls.go @@ -1,6 +1,7 @@ package utils import ( + "log" "net/url" "github.com/yauthdev/yauth/server/constants" @@ -12,5 +13,7 @@ func GetFrontendHost() string { return `localhost` } - return u.Hostname() + log.Println("hostname", "."+u.Hostname()) + + return "." + u.Hostname() }