Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions internal/cookie/admin_cookie.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
// SetAdminCookie sets the admin cookie in the response
func SetAdminCookie(gc *gin.Context, token string, adminCookieSecure bool) {
secure := adminCookieSecure
httpOnly := adminCookieSecure
httpOnly := true
hostname := parsers.GetHost(gc)
host, _ := parsers.GetHostParts(hostname)
gc.SetCookie(constants.AdminCookieName, token, 3600, "/", host, secure, httpOnly)
Expand All @@ -37,7 +37,7 @@ func GetAdminCookie(gc *gin.Context) (string, error) {
// DeleteAdminCookie sets the response cookie to empty
func DeleteAdminCookie(gc *gin.Context, adminCookieSecure bool) {
secure := adminCookieSecure
httpOnly := adminCookieSecure
httpOnly := true
hostname := parsers.GetHost(gc)
host, _ := parsers.GetHostParts(hostname)
gc.SetCookie(constants.AdminCookieName, "", -1, "/", host, secure, httpOnly)
Expand Down
4 changes: 2 additions & 2 deletions internal/cookie/cookie.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
// SetSession sets the session cookie in the response
func SetSession(gc *gin.Context, sessionID string, appCookieSecure bool) {
secure := appCookieSecure
httpOnly := appCookieSecure
httpOnly := true
hostname := parsers.GetHost(gc)
host, _ := parsers.GetHostParts(hostname)
domain := parsers.GetDomainName(hostname)
Expand Down Expand Up @@ -42,7 +42,7 @@ func SetSession(gc *gin.Context, sessionID string, appCookieSecure bool) {
// DeleteSession sets session cookies to expire
func DeleteSession(gc *gin.Context, appCookieSecure bool) {
secure := appCookieSecure
httpOnly := appCookieSecure
httpOnly := true
hostname := parsers.GetHost(gc)
host, _ := parsers.GetHostParts(hostname)
domain := parsers.GetDomainName(hostname)
Expand Down
4 changes: 2 additions & 2 deletions internal/cookie/mfa_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
// SetMfaSession sets the mfa session cookie in the response
func SetMfaSession(gc *gin.Context, sessionID string, appCookieSecure bool) {
secure := appCookieSecure
httpOnly := appCookieSecure
httpOnly := true
hostname := parsers.GetHost(gc)
host, _ := parsers.GetHostParts(hostname)
domain := parsers.GetDomainName(hostname)
Expand Down Expand Up @@ -42,7 +42,7 @@ func SetMfaSession(gc *gin.Context, sessionID string, appCookieSecure bool) {
// DeleteMfaSession deletes the mfa session cookies to expire
func DeleteMfaSession(gc *gin.Context, appCookieSecure bool) {
secure := appCookieSecure
httpOnly := appCookieSecure
httpOnly := true
hostname := parsers.GetHost(gc)
host, _ := parsers.GetHostParts(hostname)
domain := parsers.GetDomainName(hostname)
Expand Down