Skip to content

Custom SuperTokens passwordless email delivery to fully mirror shared SMTP service TLS/SSL behavior #4558

@coderabbitai

Description

@coderabbitai

Background

In PR #4551 (swap SendGrid with SMTP), the SuperTokens passwordless OTP path was wired to passwordless.SMTPService via get_passwordless_email_delivery(). The SuperTokens SMTPSettings only exposes a secure flag (mapped from SMTP_USE_SSL), whereas the shared email_service._send_smtp_email separately honors SMTP_USE_TLS to conditionally call starttls().

As a result, when SMTP_USE_SSL=false and SMTP_USE_TLS=false, the SuperTokens transporter still silently attempts STARTTLS (falling back to plaintext only if unsupported), while the shared email service skips STARTTLS entirely.

A log warning was added in #4551 to surface this discrepancy, but the root divergence remains.

Goal

Implement a custom SuperTokens EmailDeliveryOverrideInput for the passwordless recipe that internally delegates to email_service._send_smtp_email(). This would:

  • Fully respect both SMTP_USE_TLS and SMTP_USE_SSL for passwordless OTP emails, matching the shared email service behavior exactly.
  • Replace the current passwordless.SMTPService usage in get_passwordless_email_delivery().
  • Remove the need for the warning added in Swap sendgrid by SMTP #4551.

References

Requested by

@Shunmuka

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions