From a1c91513629df75e2ecd2d8e5d756c41e8a366fc Mon Sep 17 00:00:00 2001 From: dannykng Date: Fri, 9 Sep 2022 11:55:20 -0700 Subject: [PATCH] Update Auth update() and updateUser() docs --- spec/supabase_js_v1_legacy.yml | 13 ++++++------- spec/supabase_js_v2_legacy.yml | 10 +++++----- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/spec/supabase_js_v1_legacy.yml b/spec/supabase_js_v1_legacy.yml index c5358848c23..cfe850075d8 100644 --- a/spec/supabase_js_v1_legacy.yml +++ b/spec/supabase_js_v1_legacy.yml @@ -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 diff --git a/spec/supabase_js_v2_legacy.yml b/spec/supabase_js_v2_legacy.yml index 0925a05d134..db33368134c 100644 --- a/spec/supabase_js_v2_legacy.yml +++ b/spec/supabase_js_v2_legacy.yml @@ -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