MCPcopy Create free account
hub / github.com/supabase/auth / getExternalProviderType

Function getExternalProviderType

internal/api/context.go:172–187  ·  view source on GitHub ↗

getExternalProviderType returns the provider type and whether user data without email address should be allowed.

(ctx context.Context)

Source from the content-addressed store, hash-verified

170
171// getExternalProviderType returns the provider type and whether user data without email address should be allowed.
172func getExternalProviderType(ctx context.Context) (string, bool) {
173 idValue := ctx.Value(externalProviderTypeKey)
174 emailOptionalValue := ctx.Value(externalProviderEmailOptionalKey)
175
176 id, okID := idValue.(string)
177 if !okID {
178 return "", false
179 }
180
181 emailOptional, okEmailOptional := emailOptionalValue.(bool)
182 if !okEmailOptional {
183 return "", false
184 }
185
186 return id, emailOptional
187}
188
189func withExternalReferrer(ctx context.Context, token string) context.Context {
190 return context.WithValue(ctx, externalReferrerKey, token)

Callers 2

handleOAuthCallbackMethod · 0.85

Calls 1

ValueMethod · 0.45

Tested by

no test coverage detected