feat(identity): confirm the email address with a six-digit code from the message
This commit is contained in:
1 parent
c94434cd09
commit
d365a05c96
87 files changed
+4764
-224
No files matched your search
@@ -42,7 +42,7 @@ type TemplateVersion string
|
||||
// The versions that new renderings use. Changing copy means adding new
|
||||
// template files with the next version and pointing the constant at them.
|
||||
const (
|
||||
currentVerificationVersion TemplateVersion = "verification.v1"
|
||||
currentVerificationVersion TemplateVersion = "verification.v2"
|
||||
currentPasswordResetVersion TemplateVersion = "password_reset.v1"
|
||||
currentNotificationVersion TemplateVersion = "notification.v1"
|
||||
)
|
||||
@@ -110,10 +110,10 @@ func NewRenderer(publicOrigin string) (*Renderer, error) {
|
||||
return &Renderer{origin: origin, templates: templates}, nil
|
||||
}
|
||||
|
||||
// RenderVerification renders the email confirmation message. The link is
|
||||
// <origin>/verify-email#token=<token>.
|
||||
// RenderVerification renders the email confirmation message with its six-digit
|
||||
// code and the link. The link is <origin>/verify-email#token=<token>.
|
||||
func (renderer *Renderer) RenderVerification(data VerificationData) (RenderedMail, error) {
|
||||
view, err := renderer.tokenLinkView(verifyEmailPath, data.Token, data.TokenLifetime)
|
||||
view, err := renderer.verificationCodeView(data)
|
||||
if err != nil {
|
||||
return RenderedMail{}, fmt.Errorf("Renderer.RenderVerification - validate data: %w", err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user