diff --git a/web/docs/client/auth-forgotpassword.mdx b/web/docs/client/auth-forgotpassword.mdx index 88d443d08e4..0df4ea284e3 100644 --- a/web/docs/client/auth-forgotpassword.mdx +++ b/web/docs/client/auth-forgotpassword.mdx @@ -7,8 +7,44 @@ slug: auth-forgotpassword import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; + + + + +```js +const { data, error } = supabase.auth.api.resetPasswordForEmail('user@email.com') +``` + + + + + +```py +# Not yet implemented +``` + + + + + + Sends a reset request to an email address. +When the user clicks the reset link in the email they will be forwarded to: +`#access_token=x&refresh_token=y&expires_in=z&token_type=bearer&type=recovery` + +Your app must detect `type=recovery` in the fragment and display a password reset form to the user. + +You should then use the access_token in the url and new password to update the user as follows: + +```js +const { error, data } = await auth.api + .updateUser(access_token, { password : new_password }) +``` + ## Parameters diff --git a/web/docs/client/reset-password-email.mdx b/web/docs/client/reset-password-email.mdx index fca43a36403..3c769bb37e4 100644 --- a/web/docs/client/reset-password-email.mdx +++ b/web/docs/client/reset-password-email.mdx @@ -7,8 +7,44 @@ slug: reset-password-email import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; + + + + +```js +const { data, error } = supabase.auth.api.resetPasswordForEmail('user@email.com') +``` + + + + + +```py +# Not yet implemented +``` + + + + + + Sends a reset request to an email address. +When the user clicks the reset link in the email they will be forwarded to: +`#access_token=x&refresh_token=y&expires_in=z&token_type=bearer&type=recovery` + +Your app must detect `type=recovery` in the fragment and display a password reset form to the user. + +You should then use the access_token in the url and new password to update the user as follows: + +```js +const { error, data } = await auth.api + .updateUser(access_token, { password : new_password }) +``` + - string + string
@@ -65,7 +65,7 @@ A valid, logged-in JWT. ```js -const { error, data } = await api +const { error, data } = await auth.api .getUser(access_token) ``` diff --git a/web/docs/gotrue/client/api-inviteuserbyemail.mdx b/web/docs/gotrue/client/api-inviteuserbyemail.mdx index d72cea44d90..062b32fb50c 100644 --- a/web/docs/gotrue/client/api-inviteuserbyemail.mdx +++ b/web/docs/gotrue/client/api-inviteuserbyemail.mdx @@ -25,7 +25,7 @@ Sends an invite link to an email address. required - string + string
@@ -65,7 +65,7 @@ The email address of the user. ```js -const { error, data } = await api +const { error, data } = await auth.api .inviteUserByEmail('example@email.com') ``` diff --git a/web/docs/gotrue/client/api-refreshaccesstoken.mdx b/web/docs/gotrue/client/api-refreshaccesstoken.mdx index 3b68234d442..4d65f1019ea 100644 --- a/web/docs/gotrue/client/api-refreshaccesstoken.mdx +++ b/web/docs/gotrue/client/api-refreshaccesstoken.mdx @@ -25,7 +25,7 @@ Generates a new JWT. required - string + string
@@ -65,7 +65,7 @@ A valid refresh token that was returned on login. ```js -const { error, data } = await api +const { error, data } = await auth.api .refreshAccessToken(refresh_token) ``` diff --git a/web/docs/gotrue/client/api-resetpasswordforemail.mdx b/web/docs/gotrue/client/api-resetpasswordforemail.mdx index dcde2b3a4ce..ff5955f7ed0 100644 --- a/web/docs/gotrue/client/api-resetpasswordforemail.mdx +++ b/web/docs/gotrue/client/api-resetpasswordforemail.mdx @@ -7,8 +7,44 @@ slug: api-resetpasswordforemail import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; + + + + +```js +const { data, error } = supabase.auth.api.resetPasswordForEmail('user@email.com') +``` + + + + + +```py +# Not yet implemented +``` + + + + + + Sends a reset request to an email address. +When the user clicks the reset link in the email they will be forwarded to: +`#access_token=x&refresh_token=y&expires_in=z&token_type=bearer&type=recovery` + +Your app must detect `type=recovery` in the fragment and display a password reset form to the user. + +You should then use the access_token in the url and new password to update the user as follows: + +```js +const { error, data } = await auth.api + .updateUser(access_token, { password : new_password }) +``` + ## Parameters @@ -25,7 +61,7 @@ Sends a reset request to an email address. required - string + string
@@ -65,7 +101,7 @@ The email address of the user. ```js -const { error, data } = await api +const { error, data } = await auth.api .resetPasswordForEmail('example@email.com') ``` diff --git a/web/docs/gotrue/client/api-sendmagiclinkemail.mdx b/web/docs/gotrue/client/api-sendmagiclinkemail.mdx index 80739f44269..0f94d94044b 100644 --- a/web/docs/gotrue/client/api-sendmagiclinkemail.mdx +++ b/web/docs/gotrue/client/api-sendmagiclinkemail.mdx @@ -25,7 +25,7 @@ Sends a magic login link to an email address. required - string + string
@@ -65,7 +65,7 @@ The email address of the user. ```js -const { error, data } = await api +const { error, data } = await auth.api .sendMagicLinkEmail('example@email.com') ``` diff --git a/web/docs/gotrue/client/api-signinwithemail.mdx b/web/docs/gotrue/client/api-signinwithemail.mdx index 40a2a3bb7f9..2fd3e8f9521 100644 --- a/web/docs/gotrue/client/api-signinwithemail.mdx +++ b/web/docs/gotrue/client/api-signinwithemail.mdx @@ -25,7 +25,7 @@ Logs in an existing user using their email address. required - string + string
@@ -46,7 +46,7 @@ The email address of the user. required - string + string
@@ -86,7 +86,7 @@ The password of the user. ```js -const { error, data } = await api +const { error, data } = await auth.api .signInWithEmail('example@email.com', 'example-password') ``` @@ -102,4 +102,4 @@ Not yet implemented - + \ No newline at end of file diff --git a/web/docs/gotrue/client/api-signout.mdx b/web/docs/gotrue/client/api-signout.mdx index f27abf15321..5665674b433 100644 --- a/web/docs/gotrue/client/api-signout.mdx +++ b/web/docs/gotrue/client/api-signout.mdx @@ -25,7 +25,7 @@ Removes a logged-in session. required - string + string
@@ -65,7 +65,7 @@ A valid, logged-in JWT. ```js -const { error, data } = await api +const { error, data } = await auth.api .signOut(access_token) ``` diff --git a/web/docs/gotrue/client/api-signupwithemail.mdx b/web/docs/gotrue/client/api-signupwithemail.mdx index 5f284488bc0..4e1c17b3f5f 100644 --- a/web/docs/gotrue/client/api-signupwithemail.mdx +++ b/web/docs/gotrue/client/api-signupwithemail.mdx @@ -25,7 +25,7 @@ Creates a new user using their email address. required - string + string
@@ -46,7 +46,7 @@ The email address of the user. required - string + string
@@ -86,7 +86,7 @@ The password of the user. ```js -const { error, data } = await api +const { error, data } = await auth.api .signUpWithEmail('example@email.com', 'example-password') ``` diff --git a/web/docs/gotrue/client/api-updateuser.mdx b/web/docs/gotrue/client/api-updateuser.mdx index 0d03e6e8ceb..77c77588221 100644 --- a/web/docs/gotrue/client/api-updateuser.mdx +++ b/web/docs/gotrue/client/api-updateuser.mdx @@ -25,7 +25,7 @@ Updates the user data. required - string + string
@@ -46,7 +46,7 @@ A valid, logged-in JWT. required - UserAttributes + UserAttributes
@@ -86,7 +86,7 @@ The data you want to update. ```js -const { error, data } = await api +const { error, data } = await auth.api .updateUser(access_token, { password : 'Why Shinji?' }) ``` diff --git a/web/docs/gotrue/client/initializing.mdx b/web/docs/gotrue/client/initializing.mdx index 7354025487a..cd07ce3bbc5 100644 --- a/web/docs/gotrue/client/initializing.mdx +++ b/web/docs/gotrue/client/initializing.mdx @@ -57,7 +57,7 @@ const auth = new GoTrueClient({ required - object + object
@@ -78,7 +78,7 @@ No description provided. optional - | | + undefined | false | true
@@ -99,7 +99,7 @@ Set to "true" if you want to automatically refresh the token before expiring. optional - | | + undefined | false | true
@@ -120,7 +120,7 @@ Set to "true" if you want to automatically detects OAuth grants in the URL and s optional - | + undefined | reflection
@@ -141,7 +141,7 @@ Any additional headers to send to the GoTrue server. optional - Storage + Storage
@@ -162,7 +162,7 @@ No description provided. optional - | | + undefined | false | true
@@ -183,7 +183,7 @@ Set to "true" if you want to automatically save the user session into local stor optional - | + undefined | string
diff --git a/web/docs/gotrue/client/signin.mdx b/web/docs/gotrue/client/signin.mdx index 6557ca5d09e..c787fb73681 100644 --- a/web/docs/gotrue/client/signin.mdx +++ b/web/docs/gotrue/client/signin.mdx @@ -56,7 +56,7 @@ const { user, error } = await auth.signIn({ required - object + object
@@ -77,7 +77,7 @@ The user login details. optional - | + undefined | string
@@ -98,7 +98,7 @@ The user's email address. optional - | + undefined | string
@@ -119,7 +119,7 @@ The user's password. optional - Provider + Provider
diff --git a/web/docs/gotrue/client/signup.mdx b/web/docs/gotrue/client/signup.mdx index 0df405d03b7..c6cd9b6fdb0 100644 --- a/web/docs/gotrue/client/signup.mdx +++ b/web/docs/gotrue/client/signup.mdx @@ -25,7 +25,7 @@ Creates a new user. required - object + object
@@ -46,7 +46,7 @@ The user login details. required - string + string
@@ -67,7 +67,7 @@ The user's password. required - string + string
diff --git a/web/docs/gotrue/client/update.mdx b/web/docs/gotrue/client/update.mdx index 298d2cca5be..2768d8f8fbd 100644 --- a/web/docs/gotrue/client/update.mdx +++ b/web/docs/gotrue/client/update.mdx @@ -49,7 +49,7 @@ const { user, error } = await auth.update({ required - UserAttributes + UserAttributes
diff --git a/web/docs/realtime/client/disconnect.mdx b/web/docs/realtime/client/disconnect.mdx index 65a9de59a7a..37d8113bbd1 100644 --- a/web/docs/realtime/client/disconnect.mdx +++ b/web/docs/realtime/client/disconnect.mdx @@ -25,7 +25,7 @@ Disconnects the socket. optional - | + undefined | number
@@ -46,7 +46,7 @@ A numeric status code to send on disconnect. optional - | + undefined | string
diff --git a/web/docs/realtime/client/initializing.mdx b/web/docs/realtime/client/initializing.mdx index 5ce80220a8a..8d82655a683 100644 --- a/web/docs/realtime/client/initializing.mdx +++ b/web/docs/realtime/client/initializing.mdx @@ -25,7 +25,7 @@ Initializes the Socket required - string + string
@@ -46,7 +46,7 @@ The string WebSocket endpoint, ie, "ws://example.com/socket", "wss://example.com optional - Options + Options
diff --git a/web/spec/combined.json b/web/spec/combined.json index d1bc9a24b51..7953a85d1a0 100644 --- a/web/spec/combined.json +++ b/web/spec/combined.json @@ -6673,7 +6673,7 @@ "isExported": true }, "comment": { - "shortText": "Sends a reset request to an email address." + "shortText": "\n\n\n\n```js\nconst { data, error } = supabase.auth.api.resetPasswordForEmail('user@email.com')\n```\n\n\n\n\n\n```py\n# Not yet implemented\n```\n\n\n\n\n\n\nSends a reset request to an email address.\n\nWhen the user clicks the reset link in the email they will be forwarded to:\n`#access_token=x&refresh_token=y&expires_in=z&token_type=bearer&type=recovery`\n\nYour app must detect `type=recovery` in the fragment and display a password reset form to the user.\n\nYou should then use the access_token in the url and new password to update the user as follows:\n\n```js\nconst { error, data } = await auth.api\n .updateUser(access_token, { password : new_password })\n```" }, "parameters": [ { diff --git a/web/spec/gotrue.json b/web/spec/gotrue.json index 23a175b6443..12121d13ebc 100644 --- a/web/spec/gotrue.json +++ b/web/spec/gotrue.json @@ -872,7 +872,7 @@ "isExported": true }, "comment": { - "shortText": "Sends a reset request to an email address." + "shortText": "\n\n\n\n```js\nconst { data, error } = supabase.auth.api.resetPasswordForEmail('user@email.com')\n```\n\n\n\n\n\n```py\n# Not yet implemented\n```\n\n\n\n\n\n\nSends a reset request to an email address.\n\nWhen the user clicks the reset link in the email they will be forwarded to:\n`#access_token=x&refresh_token=y&expires_in=z&token_type=bearer&type=recovery`\n\nYour app must detect `type=recovery` in the fragment and display a password reset form to the user.\n\nYou should then use the access_token in the url and new password to update the user as follows:\n\n```js\nconst { error, data } = await auth.api\n .updateUser(access_token, { password : new_password })\n```" }, "parameters": [ { diff --git a/web/spec/gotrue.yml b/web/spec/gotrue.yml index 74de4f0252b..78ce93b72d7 100644 --- a/web/spec/gotrue.yml +++ b/web/spec/gotrue.yml @@ -182,7 +182,7 @@ pages: - name: Sign up a new user with email js: | ```js - const { error, data } = await api + const { error, data } = await auth.api .signUpWithEmail('example@email.com', 'example-password') ``` @@ -192,7 +192,7 @@ pages: - name: Sign in a user with email js: | ```js - const { error, data } = await api + const { error, data } = await auth.api .signInWithEmail('example@email.com', 'example-password') ``` @@ -202,7 +202,7 @@ pages: - name: Send user a passwordless login link via email js: | ```js - const { error, data } = await api + const { error, data } = await auth.api .sendMagicLinkEmail('example@email.com') ``` @@ -212,7 +212,7 @@ pages: - name: Send a user an invite link to sign up via email js: | ```js - const { error, data } = await api + const { error, data } = await auth.api .inviteUserByEmail('example@email.com') ``` @@ -222,7 +222,7 @@ pages: - name: Send a user a password reset email js: | ```js - const { error, data } = await api + const { error, data } = await auth.api .resetPasswordForEmail('example@email.com') ``` @@ -232,7 +232,7 @@ pages: - name: Sign a user out js: | ```js - const { error, data } = await api + const { error, data } = await auth.api .signOut(access_token) ``` @@ -242,7 +242,7 @@ pages: - name: Get the user details for a given user js: | ```js - const { error, data } = await api + const { error, data } = await auth.api .getUser(access_token) ``` @@ -252,7 +252,7 @@ pages: - name: Update user info that Gotrue holds (also used for setting new passwords) js: | ```js - const { error, data } = await api + const { error, data } = await auth.api .updateUser(access_token, { password : 'Why Shinji?' }) ``` @@ -262,6 +262,6 @@ pages: - name: Get a new access and refresh token using a valid refresh_token js: | ```js - const { error, data } = await api + const { error, data } = await auth.api .refreshAccessToken(refresh_token) ```