JavaScript: 通过OTP登录用户

使用魔法链接或一次性密码(OTP)登录用户。

Parameters

Examples

邮箱登录

const { data, error } = await supabase.auth.signInWithOtp({
  email: 'example@email.com',
  options: {
    emailRedirectTo: 'https://example.com/welcome'
  }
})

通过短信OTP登录

const { data, error } = await supabase.auth.signInWithOtp({
  phone: '+13334445555',
})

通过WhatsApp OTP登录

const { data, error } = await supabase.auth.signInWithOtp({
  phone: '+13334445555',
  options: {
    channel:'whatsapp',
  }
})