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

Function ParseSameSite

internal/cookie/cookie.go:17–26  ·  view source on GitHub ↗

ParseSameSite converts a string ("lax", "strict", "none") to http.SameSite. Defaults to Lax for unrecognized values. The CLI flag --app-cookie-same-site defaults to "none" for backward compatibility with cross-domain SDK setups.

(value string)

Source from the content-addressed store, hash-verified

15// Defaults to Lax for unrecognized values. The CLI flag --app-cookie-same-site
16// defaults to "none" for backward compatibility with cross-domain SDK setups.
17func ParseSameSite(value string) http.SameSite {
18 switch strings.ToLower(strings.TrimSpace(value)) {
19 case "none":
20 return http.SameSiteNoneMode
21 case "strict":
22 return http.SameSiteStrictMode
23 default:
24 return http.SameSiteLaxMode
25 }
26}
27
28// SetSession sets the session cookie in the response.
29func SetSession(gc *gin.Context, sessionID string, appCookieSecure bool, sameSite http.SameSite) {

Callers 13

LoginMethod · 0.92
SessionMethod · 0.92
SignUpMethod · 0.92
UpdateProfileMethod · 0.92
VerifyEmailMethod · 0.92
LogoutMethod · 0.92
VerifyOTPMethod · 0.92
VerifyEmailHandlerMethod · 0.92
LogoutHandlerMethod · 0.92
OAuthCallbackHandlerMethod · 0.92
AuthorizeHandlerMethod · 0.92
TokenHandlerMethod · 0.92

Calls

no outgoing calls

Tested by 1

TestParseSameSiteFunction · 0.68