From f8a6123ec72100953c7ebebf9021a7add99650e7 Mon Sep 17 00:00:00 2001 From: Heather Pundt <119376175+heatheramz@users.noreply.github.com> Date: Wed, 27 Sep 2023 08:36:03 -0700 Subject: [PATCH 1/7] Updating directory title --- src/directory/directory.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/directory/directory.mjs b/src/directory/directory.mjs index 6570e4647e2..96fb63f8cb2 100644 --- a/src/directory/directory.mjs +++ b/src/directory/directory.mjs @@ -378,7 +378,7 @@ export const directory = { filters: ['flutter'] }, { - title: 'Delete user', + title: 'Delete user account', route: '/lib/auth/delete_user', filters: ['android', 'flutter', 'ios', 'js', 'react-native'] }, From c1e5e9c9be83fd3e37e2309cc7dc288aaa0d1eb3 Mon Sep 17 00:00:00 2001 From: Heather Pundt <119376175+heatheramz@users.noreply.github.com> Date: Wed, 27 Sep 2023 11:32:21 -0700 Subject: [PATCH 2/7] Updates to delete user guide --- .../delete_user/q/platform/[platform].mdx | 98 +++++++++++++++++-- 1 file changed, 88 insertions(+), 10 deletions(-) diff --git a/src/pages/lib/auth/delete_user/q/platform/[platform].mdx b/src/pages/lib/auth/delete_user/q/platform/[platform].mdx index 911bfa22b29..f44b59d843e 100644 --- a/src/pages/lib/auth/delete_user/q/platform/[platform].mdx +++ b/src/pages/lib/auth/delete_user/q/platform/[platform].mdx @@ -1,23 +1,101 @@ export const meta = { - title: `Delete user`, - description: `Delete a user` + title: `Delete user account`, + description: `Learn how to delete a user account.` }; -import ios0 from '/src/fragments/lib/auth/native_common/delete_user/common.mdx'; + - +[comment]: # (IMPORTANT - currently the recommended links include the new location for password management for JS and RN - either we publish after that is live or change the links below - there may be more relevant recommendations. Source content below from /src/fragments/lib/auth/js/delete_user.mdx) -import flutter1 from '/src/fragments/lib/auth/native_common/delete_user/common.mdx'; +Empowering users to delete their account can improve trust and transparency. You can programmatically enable self-service account deletion with Amplify Auth. Users can delete their own account through your app interface by confirming intent before final removal. In this guide we will review how you can enable this for your users. - +Before you begin, you will need: +- An Amplify project with the Auth category configured +- The Amplify Libraries installed and configured +- A test user to delete + +## Allow my users to delete their account + +You can quickly set up account deletion for your users with the Amplify Libraries. Invoking the `deleteUser` API to delete a user from the Auth category will also sign out your user. + +You should also be aware of which data this deletion includes and does not include. Depending on your application, data associated with your user may be stored in other resources such as Amazon DynamoDB or AWS S3. It is recommended that you carefully evaluate this data and implement code to remove or otherwise sanitize it, if necessary, prior to giving users the ability to delete their own user record. + +If your application uses a Cognito User Pool, which is the default configuration for the Amazon Cognito plug-in, this action will delete the user from the Cognito User Pool. It will have no effect if you are federating with a Cognito Identity Pool alone. + + + + Before invoking the `deleteUser` API, you can first delete associated user data from the GraphQL API. For example, if you are using Amplify CLI's GraphQL transformer to persist user data via [owner-based access control](/cli/graphql/authorization-rules/#per-user--owner-based-data-access), you could follow [these instructions](https://gist.github.com/aws-amplify-ops/27954c421bd72930874d48c15c284807) to delete associated user data. This allows you to address any guidelines (such as GDPR) that require your app to delete data associated with a user who deletes their account. + + + +You can enable account deletion using the following method: + + + + +```ts +import { Auth } from 'aws-amplify'; + +export async function deleteUser() { + try { + const result = await Auth.deleteUser(); + console.log(result); + } catch (error) { + console.log('Error deleting user', error); + } +} +``` + + + +```js +import { Auth } from 'aws-amplify'; + +async function deleteUser() { + try { + const result = await Auth.deleteUser(); + console.log(result); + } catch (error) { + console.log('Error deleting user', error); + } +} +``` + + -import javascript2 from '/src/fragments/lib/auth/js/delete_user.mdx'; +We also recommend you update your UI to let your users know that their account is deleted. Again, your user will be signed out of your application when they delete their account. - +## Conclusion -import reactnative0 from '/src/fragments/lib/auth/js/delete_user.mdx'; +Congratulations! You finished the **Delete user account** guide. In this guide, you learned how to enable account deletion for your users. - +## Next steps + +Now that you enabled account deletion you may also want to add some additional features. We recommend you learn more about: + + + +- [Manage user profile](/lib/auth/manageusers/q/platform/js/) +- [Set up password change and recovery](/lib/auth/password_management/q/platform/js/) + + + + + +- [Manage user profile](/lib/auth/manageusers/q/platform/react-native/) +- [Set up password change and recovery](/lib/auth/password_management/q/platform/react-native/) + + + + + +import ios0 from '/src/fragments/lib/auth/native_common/delete_user/common.mdx'; + + + +import flutter1 from '/src/fragments/lib/auth/native_common/delete_user/common.mdx'; + + import android3 from '/src/fragments/lib/auth/native_common/delete_user/common.mdx'; From 89ca492e58d1270f304de6bb2e1feebe41aff561 Mon Sep 17 00:00:00 2001 From: Heather Pundt <119376175+heatheramz@users.noreply.github.com> Date: Wed, 27 Sep 2023 12:10:20 -0700 Subject: [PATCH 3/7] Minor update to note testing --- src/pages/lib/auth/delete_user/q/platform/[platform].mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/lib/auth/delete_user/q/platform/[platform].mdx b/src/pages/lib/auth/delete_user/q/platform/[platform].mdx index f44b59d843e..f840c493efb 100644 --- a/src/pages/lib/auth/delete_user/q/platform/[platform].mdx +++ b/src/pages/lib/auth/delete_user/q/platform/[platform].mdx @@ -63,7 +63,7 @@ async function deleteUser() { -We also recommend you update your UI to let your users know that their account is deleted. Again, your user will be signed out of your application when they delete their account. +We recommend you update your UI to let your users know that their account is deleted and test the functionality with a test user. Again, your user will be signed out of your application when they delete their account. ## Conclusion From 287e73de8522eb4809a2e644d1d563b628a52c52 Mon Sep 17 00:00:00 2001 From: Dan Kiuna Date: Thu, 5 Oct 2023 16:35:41 -0500 Subject: [PATCH 4/7] final changes --- src/pages/lib/auth/delete_user/q/platform/[platform].mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/lib/auth/delete_user/q/platform/[platform].mdx b/src/pages/lib/auth/delete_user/q/platform/[platform].mdx index f840c493efb..9c4326cef40 100644 --- a/src/pages/lib/auth/delete_user/q/platform/[platform].mdx +++ b/src/pages/lib/auth/delete_user/q/platform/[platform].mdx @@ -20,11 +20,11 @@ You can quickly set up account deletion for your users with the Amplify Librarie You should also be aware of which data this deletion includes and does not include. Depending on your application, data associated with your user may be stored in other resources such as Amazon DynamoDB or AWS S3. It is recommended that you carefully evaluate this data and implement code to remove or otherwise sanitize it, if necessary, prior to giving users the ability to delete their own user record. -If your application uses a Cognito User Pool, which is the default configuration for the Amazon Cognito plug-in, this action will delete the user from the Cognito User Pool. It will have no effect if you are federating with a Cognito Identity Pool alone. +If your application uses a Cognito User Pool, which is the default configuration, this action will only delete the user from the Cognito User Pool. It will have no effect if you are federating with a Cognito Identity Pool alone. - Before invoking the `deleteUser` API, you can first delete associated user data from the GraphQL API. For example, if you are using Amplify CLI's GraphQL transformer to persist user data via [owner-based access control](/cli/graphql/authorization-rules/#per-user--owner-based-data-access), you could follow [these instructions](https://gist.github.com/aws-amplify-ops/27954c421bd72930874d48c15c284807) to delete associated user data. This allows you to address any guidelines (such as GDPR) that require your app to delete data associated with a user who deletes their account. + Before invoking the `deleteUser` API, you may need to first delete associated user data that is not stored in Cognito. For example, if you are using Amplify GraphQL API to persist user data, you could follow [these instructions](https://gist.github.com/aws-amplify-ops/27954c421bd72930874d48c15c284807) to delete associated user data. This allows you to address any guidelines (such as GDPR) that require your app to delete data associated with a user who deletes their account. @@ -36,7 +36,7 @@ You can enable account deletion using the following method: ```ts import { Auth } from 'aws-amplify'; -export async function deleteUser() { +async function deleteUser() { try { const result = await Auth.deleteUser(); console.log(result); @@ -63,7 +63,7 @@ async function deleteUser() { -We recommend you update your UI to let your users know that their account is deleted and test the functionality with a test user. Again, your user will be signed out of your application when they delete their account. +We recommend you update your UI to let your users know that their account is deleted and test the functionality with a test user. Note that your user will be signed out of your application when they delete their account. ## Conclusion From cc836cbe8b58f1395f9f938106f7ffad9920ee96 Mon Sep 17 00:00:00 2001 From: Heather Pundt <119376175+heatheramz@users.noreply.github.com> Date: Mon, 16 Oct 2023 13:48:37 -0700 Subject: [PATCH 5/7] Removed mkdwn comment and minor edit --- src/pages/lib/auth/delete_user/q/platform/[platform].mdx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pages/lib/auth/delete_user/q/platform/[platform].mdx b/src/pages/lib/auth/delete_user/q/platform/[platform].mdx index 9c4326cef40..c8399ef7370 100644 --- a/src/pages/lib/auth/delete_user/q/platform/[platform].mdx +++ b/src/pages/lib/auth/delete_user/q/platform/[platform].mdx @@ -5,8 +5,6 @@ export const meta = { -[comment]: # (IMPORTANT - currently the recommended links include the new location for password management for JS and RN - either we publish after that is live or change the links below - there may be more relevant recommendations. Source content below from /src/fragments/lib/auth/js/delete_user.mdx) - Empowering users to delete their account can improve trust and transparency. You can programmatically enable self-service account deletion with Amplify Auth. Users can delete their own account through your app interface by confirming intent before final removal. In this guide we will review how you can enable this for your users. Before you begin, you will need: @@ -18,7 +16,7 @@ Before you begin, you will need: You can quickly set up account deletion for your users with the Amplify Libraries. Invoking the `deleteUser` API to delete a user from the Auth category will also sign out your user. -You should also be aware of which data this deletion includes and does not include. Depending on your application, data associated with your user may be stored in other resources such as Amazon DynamoDB or AWS S3. It is recommended that you carefully evaluate this data and implement code to remove or otherwise sanitize it, if necessary, prior to giving users the ability to delete their own user record. +You should also be aware of which data this deletion includes and does not include. Depending on your application, data associated with your user may be stored in other resources such as Amazon DynamoDB or Amazon S3. It is recommended that you carefully evaluate this data and implement code to remove or otherwise sanitize it, if necessary, prior to giving users the ability to delete their own user record. If your application uses a Cognito User Pool, which is the default configuration, this action will only delete the user from the Cognito User Pool. It will have no effect if you are federating with a Cognito Identity Pool alone. From 7163466195e12370c5bf26edbb4bd7ef4059b42c Mon Sep 17 00:00:00 2001 From: Heather Pundt <119376175+heatheramz@users.noreply.github.com> Date: Mon, 16 Oct 2023 13:57:34 -0700 Subject: [PATCH 6/7] Update directory --- src/directory/directory.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/directory/directory.mjs b/src/directory/directory.mjs index 573fc4bf90f..449620c388a 100644 --- a/src/directory/directory.mjs +++ b/src/directory/directory.mjs @@ -193,7 +193,7 @@ export const directory = { filters: ['flutter'] }, { - title: 'Delete user', + title: 'Delete user account', route: '/lib/auth/delete_user', filters: ['android', 'flutter', 'ios', 'js', 'react-native'] }, From fc47a798bd21bda9209658080500c9d53eb49e25 Mon Sep 17 00:00:00 2001 From: Heather Pundt <119376175+heatheramz@users.noreply.github.com> Date: Wed, 25 Oct 2023 12:56:06 -0700 Subject: [PATCH 7/7] Updating per feedback --- src/pages/lib/auth/delete_user/q/platform/[platform].mdx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pages/lib/auth/delete_user/q/platform/[platform].mdx b/src/pages/lib/auth/delete_user/q/platform/[platform].mdx index c8399ef7370..4e9c0f746de 100644 --- a/src/pages/lib/auth/delete_user/q/platform/[platform].mdx +++ b/src/pages/lib/auth/delete_user/q/platform/[platform].mdx @@ -5,7 +5,7 @@ export const meta = { -Empowering users to delete their account can improve trust and transparency. You can programmatically enable self-service account deletion with Amplify Auth. Users can delete their own account through your app interface by confirming intent before final removal. In this guide we will review how you can enable this for your users. +Empowering users to delete their account can improve trust and transparency. You can programmatically enable self-service account deletion with Amplify Auth. In this guide, we will review how you can enable this feature for your users. Before you begin, you will need: - An Amplify project with the Auth category configured @@ -14,9 +14,7 @@ Before you begin, you will need: ## Allow my users to delete their account -You can quickly set up account deletion for your users with the Amplify Libraries. Invoking the `deleteUser` API to delete a user from the Auth category will also sign out your user. - -You should also be aware of which data this deletion includes and does not include. Depending on your application, data associated with your user may be stored in other resources such as Amazon DynamoDB or Amazon S3. It is recommended that you carefully evaluate this data and implement code to remove or otherwise sanitize it, if necessary, prior to giving users the ability to delete their own user record. +You can quickly set up account deletion for your users with the Amplify Libraries. Invoking the `deleteUser` API to delete a user from the Auth category will also sign out your user. If your application uses a Cognito User Pool, which is the default configuration, this action will only delete the user from the Cognito User Pool. It will have no effect if you are federating with a Cognito Identity Pool alone.