add log to debug cookie

This commit is contained in:
Lakhan Samani 2021-07-21 21:27:12 +05:30
parent ad03bb6191
commit caf0b24b0c
2 changed files with 8 additions and 1 deletions

View File

@ -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)
}

View File

@ -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()
}