MCPcopy Index your code
hub / github.com/supabase/auth / sendPasswordChangedNotification

Method sendPasswordChangedNotification

internal/api/mail.go:590–604  ·  view source on GitHub ↗
(r *http.Request, tx *storage.Connection, u *models.User)

Source from the content-addressed store, hash-verified

588}
589
590func (a *API) sendPasswordChangedNotification(r *http.Request, tx *storage.Connection, u *models.User) error {
591 err := a.sendEmail(r, tx, u, sendEmailParams{
592 emailActionType: mail.PasswordChangedNotification,
593 })
594 if err != nil {
595 if errors.Is(err, EmailRateLimitExceeded) {
596 return apierrors.NewTooManyRequestsError(apierrors.ErrorCodeOverEmailSendRateLimit, "%s", EmailRateLimitExceeded.Error())
597 } else if herr, ok := err.(*HTTPError); ok {
598 return herr
599 }
600 return apierrors.NewInternalServerError("Error sending password changed notification email").WithInternalError(err)
601 }
602
603 return nil
604}
605
606func (a *API) sendEmailChangedNotification(r *http.Request, tx *storage.Connection, u *models.User, oldEmail string) error {
607 err := a.sendEmail(r, tx, u, sendEmailParams{

Callers 1

UserUpdateMethod · 0.95

Calls 6

sendEmailMethod · 0.95
NewTooManyRequestsErrorFunction · 0.92
NewInternalServerErrorFunction · 0.92
IsMethod · 0.45
ErrorMethod · 0.45
WithInternalErrorMethod · 0.45

Tested by

no test coverage detected