SetAdminCookie sets the admin cookie in the response
(gc *gin.Context, token string, adminCookieSecure bool)
| 12 | |
| 13 | // SetAdminCookie sets the admin cookie in the response |
| 14 | func SetAdminCookie(gc *gin.Context, token string, adminCookieSecure bool) { |
| 15 | c := BuildAdminCookie(parsers.GetHost(gc), token, adminCookieSecure) |
| 16 | gc.SetSameSite(c.SameSite) |
| 17 | gc.SetCookie(c.Name, c.Value, c.MaxAge, c.Path, c.Domain, c.Secure, c.HttpOnly) |
| 18 | } |
| 19 | |
| 20 | // BuildAdminCookie returns the admin session cookie to set on the response. |
| 21 | // Transport-agnostic so non-gin callers (the service layer, gRPC handlers) can |
nothing calls this directly
no test coverage detected