auth.update()

更新用户数据,如果有一个登录的用户的话

const { user, error } = await supabase.auth.update({email: 'new@email.com'})

参数

  • 属性 required UserAttributes

提示

用户电子邮件:电子邮件更新将向用户的当前和新的电子邮件发送一封带有确认链接的电子邮件。

用户元数据。一般来说,将用户数据存储在你的公共模式中的一个表(即public.users)中更好。 如果你的数据很少变化或者只针对登录的用户,请使用update()方法。

例子

更新已认证用户的电子邮件。

const { user, error } = await supabase.auth.update({email: 'new@email.com'})

更新认证用户的密码。

const { user, error } = await supabase.auth.update({password: 'new password'})

更新一个用户的元数据。

const { user, error } = await supabase.auth.update({
  data: { hello: 'world' }
})

results matching ""

    No results matching ""