For AI agents: the documentation index is at llms.txt. Guide pages have a markdown version at the same path with .md appended, before any query string or fragment.
verifyOTP method takes in different verification types. If a phone number is used, the type can either be .sms or .phoneChange. If an email address or a token hash is used, the type can be one of the following: .signup, .magiclink, .recovery, .invite, .emailChange, or .email.verifyOTP to sign up / sign-in a user.verifyOTP(phone:token:type:) returns the Session. verifyOTP(email:token:type:) and verifyOTP(tokenHash:type:) return a VerifyOTPResult: .signedIn(session), or .emailChangePending(message:) for the first confirmation of a secure email change..passwordRecovery for .recovery, .userUpdated for an email or phone change of the signed-in user, and .signedIn otherwise.One of `phone`, `email`, or `tokenHash` must be provided.
One of `phone`, `email`, or `tokenHash` must be provided.
The token hash from the user's email link. One of `phone`, `email`, or `tokenHash` must be provided.
undefined
The OTP sent to the user. Required if using `phone` or `email`.
let session = try await supabase.auth.verifyOTP(
phone: "+13334445555",
token: "123456",
type: .sms
)
let result = try await supabase.auth.verifyOTP(
email: "example@example-email.com",
token: "123456",
type: .signup
)
switch try await supabase.auth.verifyOTP(tokenHash: tokenHash, type: .emailChange) {
case .signedIn(let session):
print(session.user.email ?? "")
case .emailChangePending(let message):
print(message)
}