sendOtpLoginVerificationCode property

SendOtpLoginVerificationCodeFunction? sendOtpLoginVerificationCode
final

Callback to be invoked for sending outgoing one-time password emails, for passwordless logins exposed by extending EmailOtpIdpBaseEndpoint. ServerpodCloudEmailIdpConfig sets it.

If it is not set, one-time passwords are sent with sendRegistrationVerificationCode, passing the ID of the login request as its accountRequestId, and a warning is logged on first use. This works for registration emails that only contain the code. Set this callback if your registration emails use accountRequestId, e.g. in links to complete a registration, since those links do not work for a login request. Requesting a one-time password fails with a StateError if neither callback is set.

Implementation

final SendOtpLoginVerificationCodeFunction? sendOtpLoginVerificationCode;