From cb8f3634a9fca8fc726bba8711a536d1c4528ccf Mon Sep 17 00:00:00 2001 From: awalias Date: Thu, 7 Jan 2021 11:03:22 +0400 Subject: [PATCH 1/3] chore: update title of reset email and regen --- ...rd-email.mdx => auth-resetpasswordforemail.mdx} | 6 +++--- web/docs/gotrue/client/api-getuser.mdx | 2 +- web/docs/gotrue/client/api-inviteuserbyemail.mdx | 2 +- web/docs/gotrue/client/api-refreshaccesstoken.mdx | 2 +- .../gotrue/client/api-resetpasswordforemail.mdx | 2 +- web/docs/gotrue/client/api-sendmagiclinkemail.mdx | 2 +- web/docs/gotrue/client/api-signinwithemail.mdx | 6 +++--- web/docs/gotrue/client/api-signout.mdx | 2 +- web/docs/gotrue/client/api-signupwithemail.mdx | 4 ++-- web/docs/gotrue/client/api-updateuser.mdx | 4 ++-- web/docs/gotrue/client/initializing.mdx | 14 +++++++------- web/docs/gotrue/client/signin.mdx | 8 ++++---- web/docs/gotrue/client/signup.mdx | 6 +++--- web/docs/gotrue/client/update.mdx | 2 +- web/docs/realtime/client/disconnect.mdx | 4 ++-- web/docs/realtime/client/initializing.mdx | 4 ++-- web/sidebar_spec_supabase.js | 2 +- web/spec/supabase.yml | 4 ++-- 18 files changed, 38 insertions(+), 38 deletions(-) rename web/docs/client/{reset-password-email.mdx => auth-resetpasswordforemail.mdx} (92%) diff --git a/web/docs/client/reset-password-email.mdx b/web/docs/client/auth-resetpasswordforemail.mdx similarity index 92% rename from web/docs/client/reset-password-email.mdx rename to web/docs/client/auth-resetpasswordforemail.mdx index fca43a36403..4c12038ffac 100644 --- a/web/docs/client/reset-password-email.mdx +++ b/web/docs/client/auth-resetpasswordforemail.mdx @@ -1,7 +1,7 @@ --- -id: reset-password-email -title: "Reset Password (Email)" -slug: reset-password-email +id: auth-resetpasswordforemail +title: "auth.resetPasswordForEmail()" +slug: auth-resetpasswordforemail --- import Tabs from '@theme/Tabs'; diff --git a/web/docs/gotrue/client/api-getuser.mdx b/web/docs/gotrue/client/api-getuser.mdx index 963a77afe82..07cbb8982b0 100644 --- a/web/docs/gotrue/client/api-getuser.mdx +++ b/web/docs/gotrue/client/api-getuser.mdx @@ -25,7 +25,7 @@ Gets the user details. required - string + string
diff --git a/web/docs/gotrue/client/api-inviteuserbyemail.mdx b/web/docs/gotrue/client/api-inviteuserbyemail.mdx index d72cea44d90..950e3ef70ff 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
diff --git a/web/docs/gotrue/client/api-refreshaccesstoken.mdx b/web/docs/gotrue/client/api-refreshaccesstoken.mdx index 3b68234d442..88cead7f477 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
diff --git a/web/docs/gotrue/client/api-resetpasswordforemail.mdx b/web/docs/gotrue/client/api-resetpasswordforemail.mdx index dcde2b3a4ce..829d92eeed0 100644 --- a/web/docs/gotrue/client/api-resetpasswordforemail.mdx +++ b/web/docs/gotrue/client/api-resetpasswordforemail.mdx @@ -25,7 +25,7 @@ Sends a reset request to an email address. required - string + string
diff --git a/web/docs/gotrue/client/api-sendmagiclinkemail.mdx b/web/docs/gotrue/client/api-sendmagiclinkemail.mdx index 80739f44269..2eb33caf787 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
diff --git a/web/docs/gotrue/client/api-signinwithemail.mdx b/web/docs/gotrue/client/api-signinwithemail.mdx index 40a2a3bb7f9..095331ad655 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
@@ -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..0a149798953 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
diff --git a/web/docs/gotrue/client/api-signupwithemail.mdx b/web/docs/gotrue/client/api-signupwithemail.mdx index 5f284488bc0..626c8078892 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
diff --git a/web/docs/gotrue/client/api-updateuser.mdx b/web/docs/gotrue/client/api-updateuser.mdx index 0d03e6e8ceb..a3e4b578f60 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
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/sidebar_spec_supabase.js b/web/sidebar_spec_supabase.js index 6d72c6721ee..68f9470cc49 100644 --- a/web/sidebar_spec_supabase.js +++ b/web/sidebar_spec_supabase.js @@ -9,7 +9,7 @@ module.exports = { { type: 'category', label: 'Auth', - items: ['client/auth-signup', 'client/auth-signin', 'client/auth-signout', 'client/auth-session', 'client/auth-user', 'client/auth-update', 'client/auth-onauthstatechange', 'client/reset-password-email'], + items: ['client/auth-signup', 'client/auth-signin', 'client/auth-signout', 'client/auth-session', 'client/auth-user', 'client/auth-update', 'client/auth-onauthstatechange', 'client/auth-resetpasswordforemail'], collapsed: false, }, { diff --git a/web/spec/supabase.yml b/web/spec/supabase.yml index 1e57bca1e80..0698be8c052 100644 --- a/web/spec/supabase.yml +++ b/web/spec/supabase.yml @@ -42,7 +42,7 @@ info: - auth.user() - auth.update() - auth.onAuthStateChange() - - Reset Password (Email) + - auth.resetPasswordForEmail() - name: 'Data' items: - select() @@ -361,7 +361,7 @@ pages: # Not yet implemented ``` - Reset Password (Email): + auth.resetPasswordForEmail(): $ref: '@supabase/gotrue-js."GoTrueApi".GoTrueApi.resetPasswordForEmail' examples: - name: Reset password From 4829204d91e4422d814edcd8dfcab447574c75a2 Mon Sep 17 00:00:00 2001 From: awalias Date: Thu, 7 Jan 2021 11:41:06 +0400 Subject: [PATCH 2/3] chore: adds instructions for resetting password after email sent --- web/docs/client/auth-forgotpassword.mdx | 36 +++++++++++++++++++ ...dforemail.mdx => reset-password-email.mdx} | 22 +++++++++--- web/docs/gotrue/client/api-getuser.mdx | 2 +- .../gotrue/client/api-inviteuserbyemail.mdx | 2 +- .../gotrue/client/api-refreshaccesstoken.mdx | 2 +- .../client/api-resetpasswordforemail.mdx | 2 +- .../gotrue/client/api-sendmagiclinkemail.mdx | 2 +- .../gotrue/client/api-signinwithemail.mdx | 2 +- web/docs/gotrue/client/api-signout.mdx | 2 +- .../gotrue/client/api-signupwithemail.mdx | 2 +- web/docs/gotrue/client/api-updateuser.mdx | 2 +- web/sidebar_spec_supabase.js | 2 +- web/spec/gotrue.yml | 18 +++++----- web/spec/supabase.yml | 4 +-- 14 files changed, 74 insertions(+), 26 deletions(-) rename web/docs/client/{auth-resetpasswordforemail.mdx => reset-password-email.mdx} (70%) 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/auth-resetpasswordforemail.mdx b/web/docs/client/reset-password-email.mdx similarity index 70% rename from web/docs/client/auth-resetpasswordforemail.mdx rename to web/docs/client/reset-password-email.mdx index 4c12038ffac..e585ccb0bd6 100644 --- a/web/docs/client/auth-resetpasswordforemail.mdx +++ b/web/docs/client/reset-password-email.mdx @@ -1,14 +1,12 @@ --- -id: auth-resetpasswordforemail -title: "auth.resetPasswordForEmail()" -slug: auth-resetpasswordforemail +id: reset-password-email +title: "Reset Password (Email)" +slug: reset-password-email --- import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -Sends a reset request to an email address. - +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/gotrue/client/api-getuser.mdx b/web/docs/gotrue/client/api-getuser.mdx index 07cbb8982b0..b8b15072fdd 100644 --- a/web/docs/gotrue/client/api-getuser.mdx +++ b/web/docs/gotrue/client/api-getuser.mdx @@ -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 950e3ef70ff..062b32fb50c 100644 --- a/web/docs/gotrue/client/api-inviteuserbyemail.mdx +++ b/web/docs/gotrue/client/api-inviteuserbyemail.mdx @@ -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 88cead7f477..4d65f1019ea 100644 --- a/web/docs/gotrue/client/api-refreshaccesstoken.mdx +++ b/web/docs/gotrue/client/api-refreshaccesstoken.mdx @@ -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 829d92eeed0..acc8b22c9ba 100644 --- a/web/docs/gotrue/client/api-resetpasswordforemail.mdx +++ b/web/docs/gotrue/client/api-resetpasswordforemail.mdx @@ -65,7 +65,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 2eb33caf787..0f94d94044b 100644 --- a/web/docs/gotrue/client/api-sendmagiclinkemail.mdx +++ b/web/docs/gotrue/client/api-sendmagiclinkemail.mdx @@ -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 095331ad655..2fd3e8f9521 100644 --- a/web/docs/gotrue/client/api-signinwithemail.mdx +++ b/web/docs/gotrue/client/api-signinwithemail.mdx @@ -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') ``` diff --git a/web/docs/gotrue/client/api-signout.mdx b/web/docs/gotrue/client/api-signout.mdx index 0a149798953..5665674b433 100644 --- a/web/docs/gotrue/client/api-signout.mdx +++ b/web/docs/gotrue/client/api-signout.mdx @@ -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 626c8078892..4e1c17b3f5f 100644 --- a/web/docs/gotrue/client/api-signupwithemail.mdx +++ b/web/docs/gotrue/client/api-signupwithemail.mdx @@ -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 a3e4b578f60..77c77588221 100644 --- a/web/docs/gotrue/client/api-updateuser.mdx +++ b/web/docs/gotrue/client/api-updateuser.mdx @@ -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/sidebar_spec_supabase.js b/web/sidebar_spec_supabase.js index 68f9470cc49..6d72c6721ee 100644 --- a/web/sidebar_spec_supabase.js +++ b/web/sidebar_spec_supabase.js @@ -9,7 +9,7 @@ module.exports = { { type: 'category', label: 'Auth', - items: ['client/auth-signup', 'client/auth-signin', 'client/auth-signout', 'client/auth-session', 'client/auth-user', 'client/auth-update', 'client/auth-onauthstatechange', 'client/auth-resetpasswordforemail'], + items: ['client/auth-signup', 'client/auth-signin', 'client/auth-signout', 'client/auth-session', 'client/auth-user', 'client/auth-update', 'client/auth-onauthstatechange', 'client/reset-password-email'], collapsed: false, }, { 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) ``` diff --git a/web/spec/supabase.yml b/web/spec/supabase.yml index 0698be8c052..1e57bca1e80 100644 --- a/web/spec/supabase.yml +++ b/web/spec/supabase.yml @@ -42,7 +42,7 @@ info: - auth.user() - auth.update() - auth.onAuthStateChange() - - auth.resetPasswordForEmail() + - Reset Password (Email) - name: 'Data' items: - select() @@ -361,7 +361,7 @@ pages: # Not yet implemented ``` - auth.resetPasswordForEmail(): + Reset Password (Email): $ref: '@supabase/gotrue-js."GoTrueApi".GoTrueApi.resetPasswordForEmail' examples: - name: Reset password From 8edaa580bc5b42ad79457e2846a2e78ad6142687 Mon Sep 17 00:00:00 2001 From: awalias Date: Thu, 7 Jan 2021 12:03:49 +0400 Subject: [PATCH 3/3] fix: description text wasnt being persisted --- web/docs/client/reset-password-email.mdx | 24 +++++++++++++ .../client/api-resetpasswordforemail.mdx | 36 +++++++++++++++++++ web/spec/combined.json | 2 +- web/spec/gotrue.json | 2 +- 4 files changed, 62 insertions(+), 2 deletions(-) diff --git a/web/docs/client/reset-password-email.mdx b/web/docs/client/reset-password-email.mdx index e585ccb0bd6..3c769bb37e4 100644 --- a/web/docs/client/reset-password-email.mdx +++ b/web/docs/client/reset-password-email.mdx @@ -45,6 +45,30 @@ const { error, data } = await auth.api .updateUser(access_token, { password : new_password }) ``` + + + + +```js +const { data, error } = supabase.auth.api.resetPasswordForEmail('user@email.com') +``` + + + + + +```py +# Not yet implemented +``` + + + + + + ## Parameters diff --git a/web/docs/gotrue/client/api-resetpasswordforemail.mdx b/web/docs/gotrue/client/api-resetpasswordforemail.mdx index acc8b22c9ba..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 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": [ {