Swift: Resend an OTP
- Resends a signup confirmation, email change, or phone change email to the user.
- Passwordless sign-ins can be resent by calling the
signInWithOTP()
method again.
- Password recovery emails can be resent by calling the
resetPasswordForEmail()
method again.
- This method only resends an email or phone OTP to the user if there an initial signup, email change, or phone change request was made.
- You can specify a redirect URL when you resend an email link using the
emailRedirectTo
option.
Examples
Resend an email signup confirmation
try await supabase.auth.resend(
email: "email@example.com",
type: .signup,
emailRedirectTo: URL(string: "my-app-scheme://")
)
Resend a phone signup confirmation
try await supabase.auth.resend(
phone: "1234567890",
type: .sms
)
Resend email change email
try await supabase.auth.resend(
email: "email@example.com",
type: .emailChange
)
Resend phone change OTP
try await supabase.auth.resend(
phone: "1234567890",
type: .phoneChange
)