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

Function ApplyToGin

internal/service/sideeffects.go:102–114  ·  view source on GitHub ↗

ApplyToGin writes the response side-effects to a gin.Context. The gin-aware transport calls this once per request after a service method returns successfully. A nil receiver is a no-op (service methods that have no side-effects may return nil).

(gc *gin.Context, side *ResponseSideEffects)

Source from the content-addressed store, hash-verified

100// successfully. A nil receiver is a no-op (service methods that have no
101// side-effects may return nil).
102func ApplyToGin(gc *gin.Context, side *ResponseSideEffects) {
103 if side == nil || gc == nil {
104 return
105 }
106 for _, c := range side.Cookies {
107 if c == nil {
108 continue
109 }
110 // gin.SetSameSite is per-call and must be set before SetCookie.
111 gc.SetSameSite(c.SameSite)
112 gc.SetCookie(c.Name, c.Value, c.MaxAge, c.Path, c.Domain, c.Secure, c.HttpOnly)
113 }
114}

Callers 15

ResendVerifyEmailMethod · 0.92
MagicLinkLoginMethod · 0.92
ResendOTPMethod · 0.92
DeactivateAccountMethod · 0.92
AdminLoginMethod · 0.92
LoginMethod · 0.92
SessionMethod · 0.92
ResetPasswordMethod · 0.92
SignUpMethod · 0.92
UpdateProfileMethod · 0.92
VerifyEmailMethod · 0.92
AdminSessionMethod · 0.92

Calls

no outgoing calls

Tested by 2

TestApplyToGin_NilSafeFunction · 0.68