JavaScript: Verify and log in through OTP

Log in a user given a User supplied OTP or TokenHash received through mobile or email.

Parameters

Examples

Verify Signup One-Time Password (OTP)

const \{ data, error \} = await supabase.auth.verifyOtp(\{ email, token, type: 'email'\})

Verify Sms One-Time Password (OTP)

const \{ data, error \} = await supabase.auth.verifyOtp(\{ phone, token, type: 'sms'\})

Verify Email Auth (Token Hash)

const \{ data, error \} = await supabase.auth.verifyOtp(\{ token_hash: tokenHash, type: 'email'\})