Skip to content

Commit

Permalink
chore: merge release/2.165.0 into master (supabase#1875)
Browse files Browse the repository at this point in the history
This merges a small release hotfix committed into the releases branch
back into master.

---------

Co-authored-by: Kang Ming <kang.ming1996@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 16, 2024
1 parent fd82601 commit a3eecd1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [2.165.1](https://github.com/supabase/auth/compare/v2.165.0...v2.165.1) (2024-12-06)


### Bug Fixes

* allow setting the mailer service headers as strings ([#1861](https://github.com/supabase/auth/issues/1861)) ([7907b56](https://github.com/supabase/auth/commit/7907b566228f7e2d76049b44cfe0cc808c109100))

## [2.165.0](https://github.com/supabase/auth/compare/v2.164.0...v2.165.0) (2024-12-05)


Expand Down
4 changes: 2 additions & 2 deletions internal/conf/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ type MailerConfiguration struct {
// EXPERIMENTAL: May be removed in a future release.
EmailValidationExtended bool `json:"email_validation_extended" split_words:"true" default:"false"`
EmailValidationServiceURL string `json:"email_validation_service_url" split_words:"true"`
EmailValidationServiceHeaders string `json:"email_validation_service_key" split_words:"true"`
EmailValidationServiceHeaders string `json:"email_validation_service_headers" split_words:"true"`

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

Expand Down
5 changes: 3 additions & 2 deletions internal/mailer/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func (ev *EmailValidator) validateService(ctx context.Context, email string) err
}

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

if res.StatusCode != http.StatusOK {
if res.StatusCode/100 != 2 {
// we ignore the error here just in case the service is down
return nil
}

Expand Down

0 comments on commit a3eecd1

Please sign in to comment.