MCPcopy Create free account
hub / github.com/authorizerdev/authorizer / SetAdminCookie

Function SetAdminCookie

internal/cookie/admin_cookie.go:14–18  ·  view source on GitHub ↗

SetAdminCookie sets the admin cookie in the response

(gc *gin.Context, token string, adminCookieSecure bool)

Source from the content-addressed store, hash-verified

12
13// SetAdminCookie sets the admin cookie in the response
14func 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

Callers

nothing calls this directly

Calls 2

GetHostFunction · 0.92
BuildAdminCookieFunction · 0.85

Tested by

no test coverage detected