chore: Move token from params to headers (#11281)

* chore: Move token from params to body

* chore: Add type

* wip

* chore: clean up

* clean ip
This commit is contained in:
Oli Juhl
2025-02-27 00:41:16 +08:00
committed by GitHub
parent 4ec5219a72
commit 54a6ef91ac
7 changed files with 96 additions and 75 deletions

View File

@@ -15,15 +15,15 @@ import { emitEventStep, useRemoteQueryStep } from "../../common"
* [Generate Reset Password Token for Admin](https://docs.medusajs.com/api/admin#auth_postactor_typeauth_providerresetpassword)
* and [Generate Reset Password Token for Customer](https://docs.medusajs.com/api/store#auth_postactor_typeauth_providerresetpassword)
* API Routes.
*
*
* The workflow emits the `auth.password_reset` event, which you can listen to in
* a [subscriber](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers). Follow
* [this guide](https://docs.medusajs.com/resources/commerce-modules/auth/reset-password) to learn
* how to handle this event.
*
*
* You can use this workflow within your customizations or your own custom workflows, allowing you to
* generate reset password tokens within your custom flows.
*
*
* @example
* const { result } = await generateResetPasswordTokenWorkflow(container)
* .run({
@@ -34,9 +34,9 @@ import { emitEventStep, useRemoteQueryStep } from "../../common"
* secret: "jwt_123" // jwt secret
* }
* })
*
*
* @summary
*
*
* Generate a reset password token for a user or customer.
*/
export const generateResetPasswordTokenWorkflow = createWorkflow(
@@ -90,11 +90,6 @@ export const generateResetPasswordTokenWorkflow = createWorkflow(
eventName: AuthWorkflowEvents.PASSWORD_RESET,
data: {
entity_id: input.entityId,
/**
* Use `actor_type` instead. Will be removed in a future version.
* @deprecated
*/
actorType: input.actorType,
actor_type: input.actorType,
token,
},