From 3b0aa51e1d088f0aab9573393ace7675fabf0e74 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Wed, 27 Nov 2024 13:45:33 +0200 Subject: [PATCH] docs: update actor type in reset password event payload --- .../app/commerce-modules/auth/reset-password/page.mdx | 8 ++++---- www/apps/resources/app/events-reference/page.mdx | 3 ++- www/apps/resources/generated/edit-dates.mjs | 5 +++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/www/apps/resources/app/commerce-modules/auth/reset-password/page.mdx b/www/apps/resources/app/commerce-modules/auth/reset-password/page.mdx index 432d0036c023d..2d93fad79924a 100644 --- a/www/apps/resources/app/commerce-modules/auth/reset-password/page.mdx +++ b/www/apps/resources/app/commerce-modules/auth/reset-password/page.mdx @@ -49,10 +49,10 @@ export default async function resetPasswordTokenHandler({ event: { data: { entity_id: email, token, - actor_type, + actorType: actor_type, } }, container, -}: SubscriberArgs<{ entity_id: string, token: string, actor_type: string }>) { +}: SubscriberArgs<{ entity_id: string, token: string, actorType: string }>) { const notificationModuleService = container.resolve( Modules.NOTIFICATION ) @@ -81,11 +81,11 @@ You subscribe to the `auth.password_reset` event. The event has a data payload o - `entity_id`: The identifier of the user. When using the `emailpass` provider, it's the user's email. - `token`: The token to reset the user's password. -- `actor_type`: The user's actor type. For example, if the user is a customer, the `actor_type` is `customer`. If it's an admin user, the `actor_type` is `user`. +- `actorType`: The user's actor type. For example, if the user is a customer, the `actorType` is `customer`. If it's an admin user, the `actorType` is `user`. In the subscriber, you: -- Decide the frontend URL based on whether the user is a customer or admin user by checking the value of `actor_type`. +- Decide the frontend URL based on whether the user is a customer or admin user by checking the value of `actorType`. - Resolve the Notification Module and use its `createNotifications` method to send the notification. - You pass to the `createNotifications` method an object having the following properties: - `to`: The identifier to send the notification to, which in this case is the email. diff --git a/www/apps/resources/app/events-reference/page.mdx b/www/apps/resources/app/events-reference/page.mdx index 5fa7fbd75c7c2..56fbf94403329 100644 --- a/www/apps/resources/app/events-reference/page.mdx +++ b/www/apps/resources/app/events-reference/page.mdx @@ -34,8 +34,9 @@ This documentation page includes the list of all events emitted by [Medusa's wor ```ts blockStyle="inline" { - entityId, // The ID of the user + entity_id, // The user's identifier, such as email. token, // The reset token + actorType // The user's actor type, such as `user` or `customer` } ``` diff --git a/www/apps/resources/generated/edit-dates.mjs b/www/apps/resources/generated/edit-dates.mjs index b56f4b98fec8e..fa86e7b51e44e 100644 --- a/www/apps/resources/generated/edit-dates.mjs +++ b/www/apps/resources/generated/edit-dates.mjs @@ -2201,7 +2201,7 @@ export const generatedEditDates = { "app/admin-components/layouts/single-column/page.mdx": "2024-10-07T11:16:06.435Z", "app/admin-components/layouts/two-column/page.mdx": "2024-10-07T11:16:10.092Z", "app/admin-components/components/forms/page.mdx": "2024-10-09T12:48:04.229Z", - "app/commerce-modules/auth/reset-password/page.mdx": "2024-09-25T09:36:26.592Z", + "app/commerce-modules/auth/reset-password/page.mdx": "2024-11-27T11:42:04.996Z", "app/storefront-development/customers/reset-password/page.mdx": "2024-09-25T10:21:46.647Z", "app/commerce-modules/api-key/links-to-other-modules/page.mdx": "2024-10-08T08:05:36.596Z", "app/commerce-modules/cart/extend/page.mdx": "2024-10-08T11:22:22.523Z", @@ -3392,5 +3392,6 @@ export const generatedEditDates = { "references/types/types.InventoryTypes/page.mdx": "2024-11-25T17:49:27.667Z", "references/types/types.StockLocationTypes/page.mdx": "2024-11-25T17:49:28.127Z", "references/user/interfaces/user.IMessageAggregator/page.mdx": "2024-11-25T17:49:59.536Z", - "references/utils/utils.PromotionUtils/page.mdx": "2024-11-25T17:49:28.611Z" + "references/utils/utils.PromotionUtils/page.mdx": "2024-11-25T17:49:28.611Z", + "app/events-reference/page.mdx": "2024-11-27T11:41:23.801Z" } \ No newline at end of file