Skip to main content

Start an OTP login

Send a one-time code to a phone number. If your application is configured for email OTP, use the email-address identifier instead to send the code via email. The SDK sends the code and tracks the verification on the device. Pass the code the user enters to checkOTP to complete the login.
For email OTP, use .emailAddress:

Check the OTP code

Verify the code entered by the user. On success, checkOTP returns the authenticated PreludeUser and the SDK persists the access and refresh tokens in the platform’s secure store.

Resend the OTP

If the user didn’t receive the code, ask the server to resend the most recently-issued OTP. Resend reuses the verification opened by startOTPLogin, so there’s no need to start the flow over.
Replace ContentView.swift with:
ContentView.swift