From dfc986b493839cbe96c3ad6c7fbea9484c3e940e Mon Sep 17 00:00:00 2001 From: Kang Ming Date: Tue, 22 Mar 2022 21:55:00 +0100 Subject: [PATCH 1/2] update auth docs --- web/spec/supabase.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/spec/supabase.yml b/web/spec/supabase.yml index 0c6150b4227..f2eb0030e23 100644 --- a/web/spec/supabase.yml +++ b/web/spec/supabase.yml @@ -777,7 +777,6 @@ pages: auth.api.createUser(): title: 'createUser()' - # $ref: '@supabase/gotrue-js.GoTrueApi.createUser' $ref: '@supabase/gotrue-js.GoTrueApi.createUser' notes: | - Requires a `service_role` key. @@ -790,7 +789,8 @@ pages: const { data: user, error } = await supabase.auth.api.createUser({ email: 'user@email.com', password: 'password', - data: { name: 'Yoda' } + data: { name: 'Yoda' }, + email_confirm: true }) ``` @@ -944,7 +944,7 @@ pages: ```js const { data: user, error } = await supabase.auth.api.updateUserById( '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4', - { phone_number: true } + { phone_confirm: true } ) ``` From 83553cd0f54bfdfb1b0c513f234adbdca7f1abc2 Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Sun, 27 Mar 2022 20:39:45 +0200 Subject: [PATCH 2/2] Adds example for createUser --- web/spec/supabase.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/web/spec/supabase.yml b/web/spec/supabase.yml index f2eb0030e23..56c133be924 100644 --- a/web/spec/supabase.yml +++ b/web/spec/supabase.yml @@ -781,6 +781,7 @@ pages: notes: | - Requires a `service_role` key. - This function should be called on a server. Never expose your `service_role` key in the browser. + - If you do not provide the `email_confirm` and `phone_confirm` options to this function, both will default to false. examples: - name: Create a new user. isSpotlight: true @@ -789,10 +790,26 @@ pages: const { data: user, error } = await supabase.auth.api.createUser({ email: 'user@email.com', password: 'password', - data: { name: 'Yoda' }, + data: { name: 'Yoda' } + }) + - name: Auto-confirm email. + isSpotlight: true + js: | + ```js + const { data: user, error } = await supabase.auth.api.createUser({ + email: 'user@email.com', email_confirm: true }) ``` + - name: Auto-confirm phone. + isSpotlight: true + js: | + ```js + const { data: user, error } = await supabase.auth.api.createUser({ + phone: '1234567890', + phone_confirm: true + }) + ``` auth.api.deleteUser(): title: 'deleteUser()'