update getting hostname logic

This commit is contained in:
Lakhan Samani
2021-07-22 05:22:53 +05:30
parent 66f5767355
commit bc3963edde
2 changed files with 24 additions and 5 deletions

View File

@@ -14,10 +14,11 @@ func SetCookie(gc *gin.Context, token string) {
if !constants.IS_PROD {
secure = false
}
host := GetFrontendHost()
log.Println("-> is cookie secure", secure)
log.Println("-> host:", host)
gc.SetCookie(constants.COOKIE_NAME, token, 3600, "/", GetFrontendHost(), secure, httpOnly)
gc.SetCookie(constants.COOKIE_NAME, token, 3600, "/", host, secure, httpOnly)
}
func DeleteCookie(gc *gin.Context) {