通过删除身份认证解除用户与某身份的关联,解绑后该身份将无法用于登录。
unlinkIdentity()
方法// 获取用户关联的所有身份
const identities = await supabase.auth.getUserIdentities()
// 查找Google身份
const googleIdentity = identities.find(
identity => identity.provider === 'google'
)
// 解除Google身份关联
const { error } = await supabase.auth.unlinkIdentity(googleIdentity)