Update Auth update() and updateUser() docs

This commit is contained in:
dannykng committed 2022-09-09 11:55:20 -07:00
1 parent 5b16471c7a
commit a1c9151362
2 files changed
+11 -12

No files matched your search

+6 -7
View File
@@ -329,27 +329,26 @@ pages:
title: 'update()'
$ref: '@supabase/gotrue-js.GoTrueClient.update'
notes: |
User email: Email updates will send an email to both the user's current and new email with a confirmation link by default.
To toggle this behavior off and only send a single confirmation link to the new email, toggle "Double confirm email changes" under "Authentication" -> "Settings" off.
User email: By Default, email updates sends a confirmation link to both the user's current and new email.
To only send a confirmation link to the user's new email, disable **Secure email change** in your project's [email auth provider settings](https://app.supabase.com/project/_/auth/settings).
User metadata: It's generally better to store user data in a table inside your public schema (i.e. `public.users`).
User metadata: It's generally better to store user data in a table within your public schema (i.e., `public.users`).
Use the `update()` method if you have data which rarely changes or is specific only to the logged in user.
examples:
- name: Update email for authenticated user.
- name: Update the email for an authenticated user
description: Sends a "Confirm Email Change" email to the new email address.
isSpotlight: true
js: |
```js
const { user, error } = await supabase.auth.update({email: 'new@email.com'})
```
- name: Update password for authenticated user.
- name: Update the password for an authenticated user
isSpotlight: true
js: |
```js
const { user, error } = await supabase.auth.update({password: 'new password'})
```
- name: Update a user's metadata.
- name: Update the user's metadata
isSpotlight: true
js: |
```js
+5 -5
View File
@@ -288,23 +288,23 @@ pages:
$ref: '@supabase/gotrue-js.GoTrueClient.updateUser'
notes: |
- In order to use the `updateUser()` method, the user needs to be signed in first.
- Email updates will send an email to both the user's current and new email with a confirmation link by default.
To only send a single confirmation link to the user's new email, you can toggle the "Secure email change" setting in [your project](https://app.supabase.com/project/_/auth/settings).
- By Default, email updates sends a confirmation link to both the user's current and new email.
To only send a confirmation link to the user's new email, disable **Secure email change** in your project's [email auth provider settings](https://app.supabase.com/project/_/auth/settings).
examples:
- name: Update the email of an authenticated user
- name: Update the email for an authenticated user
description: Sends a "Confirm Email Change" email to the new email address.
isSpotlight: false
js: |
```js
const { data, error } = await supabase.auth.updateUser({email: 'new@email.com'})
```
- name: Update the password of an authenticated user
- name: Update the password for an authenticated user
isSpotlight: false
js: |
```js
const { data, error } = await supabase.auth.updateUser({password: 'new password'})
```
- name: Update the user's metadata.
- name: Update the user's metadata
isSpotlight: true
js: |
```js