JavaScript: 通过OTP验证并登录

通过用户提供的移动端或邮箱收到的OTP/TokenHash实现用户登录。

Parameters

Examples

验证注册一次性密码(OTP)

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

验证短信一次性密码(OTP)

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

验证邮箱认证(令牌哈希)

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