Merge pull request #6010 from supabase/km/docs-update-auth

[WIP] update auth docs
This commit is contained in:
Copple authored and GitHub committed 2022-03-27 20:40:49 +02:00
commit ba3265d4bb
1 file changed
+19 -2
+19 -2
View File
@@ -777,11 +777,11 @@ pages:
auth.api.createUser():
title: 'createUser()'
# $ref: '@supabase/gotrue-js.GoTrueApi.createUser'
$ref: '@supabase/gotrue-js.GoTrueApi.createUser'
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
@@ -792,6 +792,23 @@ pages:
password: 'password',
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():
@@ -944,7 +961,7 @@ pages:
```js
const { data: user, error } = await supabase.auth.api.updateUserById(
'6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',
{ phone_number: true }
{ phone_confirm: true }
)
```