getExternalProviderType returns the provider type and whether user data without email address should be allowed.
(ctx context.Context)
| 170 | |
| 171 | // getExternalProviderType returns the provider type and whether user data without email address should be allowed. |
| 172 | func 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 | |
| 189 | func withExternalReferrer(ctx context.Context, token string) context.Context { |
| 190 | return context.WithValue(ctx, externalReferrerKey, token) |
no test coverage detected