feat: mail service

This commit is contained in:
Ilia Denisov
2026-04-17 18:39:16 +02:00
committed by GitHub
parent 23ffcb7535
commit 5b7593e6f6
183 changed files with 31215 additions and 248 deletions
+6
View File
@@ -55,6 +55,11 @@ type SendEmailCodeInput struct {
// Email is the single client e-mail address that should receive the login
// code challenge.
Email string `json:"email"`
// PreferredLanguage stores the canonical BCP 47 language tag derived from
// the public Accept-Language header for upstream auth-mail localization and
// create-only user registration context.
PreferredLanguage string `json:"-"`
}
// SendEmailCodeResult describes the public REST and adapter payload returned
@@ -204,6 +209,7 @@ func handleSendEmailCode(authService AuthServiceClient, timeout time.Duration) g
abortInvalidRequest(c, err.Error())
return
}
input.PreferredLanguage = resolvePreferredLanguage(c.Request.Header.Get("Accept-Language"))
callCtx, cancel := context.WithTimeout(c.Request.Context(), timeout)
defer cancel()