Skip to content

Commit a3eecd1

Browse files
cstocktonkangmingtaygithub-actions[bot]
authored
chore: merge release/2.165.0 into master (#1875)
This merges a small release hotfix committed into the releases branch back into master. --------- Co-authored-by: Kang Ming <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent fd82601 commit a3eecd1

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [2.165.1](https://github.com/supabase/auth/compare/v2.165.0...v2.165.1) (2024-12-06)
4+
5+
6+
### Bug Fixes
7+
8+
* allow setting the mailer service headers as strings ([#1861](https://github.com/supabase/auth/issues/1861)) ([7907b56](https://github.com/supabase/auth/commit/7907b566228f7e2d76049b44cfe0cc808c109100))
9+
310
## [2.165.0](https://github.com/supabase/auth/compare/v2.164.0...v2.165.0) (2024-12-05)
411

512

internal/conf/configuration.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ type MailerConfiguration struct {
403403
// EXPERIMENTAL: May be removed in a future release.
404404
EmailValidationExtended bool `json:"email_validation_extended" split_words:"true" default:"false"`
405405
EmailValidationServiceURL string `json:"email_validation_service_url" split_words:"true"`
406-
EmailValidationServiceHeaders string `json:"email_validation_service_key" split_words:"true"`
406+
EmailValidationServiceHeaders string `json:"email_validation_service_headers" split_words:"true"`
407407

408408
serviceHeaders map[string][]string `json:"-"`
409409
}
@@ -414,7 +414,7 @@ func (c *MailerConfiguration) Validate() error {
414414
if c.EmailValidationServiceHeaders != "" {
415415
err := json.Unmarshal([]byte(c.EmailValidationServiceHeaders), &headers)
416416
if err != nil {
417-
return fmt.Errorf("conf: SMTP headers not a map[string][]string format: %w", err)
417+
return fmt.Errorf("conf: mailer validation headers not a map[string][]string format: %w", err)
418418
}
419419
}
420420

internal/mailer/validate.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ func (ev *EmailValidator) validateService(ctx context.Context, email string) err
197197
}
198198

199199
rdr := bytes.NewReader(reqData)
200-
req, err := http.NewRequestWithContext(ctx, "GET", ev.serviceURL, rdr)
200+
req, err := http.NewRequestWithContext(ctx, http.MethodPost, ev.serviceURL, rdr)
201201
if err != nil {
202202
return nil
203203
}
@@ -218,7 +218,8 @@ func (ev *EmailValidator) validateService(ctx context.Context, email string) err
218218
Valid *bool `json:"valid"`
219219
}{}
220220

221-
if res.StatusCode != http.StatusOK {
221+
if res.StatusCode/100 != 2 {
222+
// we ignore the error here just in case the service is down
222223
return nil
223224
}
224225

0 commit comments

Comments
 (0)