MCPcopy Create free account
hub / github.com/supabase/auth / sendMFAFactorUnenrolledNotification

Method sendMFAFactorUnenrolledNotification

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

Source from the content-addressed store, hash-verified

689}
690
691func (a *API) sendMFAFactorUnenrolledNotification(r *http.Request, tx *storage.Connection, u *models.User, factorType string) error {
692 err := a.sendEmail(r, tx, u, sendEmailParams{
693 emailActionType: mail.MFAFactorUnenrolledNotification,
694 factorType: factorType,
695 })
696 if err != nil {
697 if errors.Is(err, EmailRateLimitExceeded) {
698 return apierrors.NewTooManyRequestsError(apierrors.ErrorCodeOverEmailSendRateLimit, "%s", EmailRateLimitExceeded.Error())
699 } else if herr, ok := err.(*HTTPError); ok {
700 return herr
701 }
702 return apierrors.NewInternalServerError("Error sending MFA factor unenrolled notification email").WithInternalError(err)
703 }
704
705 return nil
706}
707
708func (a *API) validateEmail(email string) (string, error) {
709 if email == "" {

Calls 6

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