Back to Medusa

Auth Module Events Reference

www/apps/resources/references/module_events/module_events.Auth/page.mdx

2.14.22.1 KB
Original Source

import { TypeList } from "docs-ui"

Auth Module Events Reference

This reference shows all the events emitted by the Medusa application related to the Auth Module. If you use the module outside the Medusa application, these events aren't emitted.

Summary

<Table> <Table.Header> <Table.Row> <Table.HeaderCell> Event </Table.HeaderCell> <Table.HeaderCell> Description </Table.HeaderCell> </Table.Row> </Table.Header> <Table.Body> <Table.Row> <Table.Cell> [auth.password_reset](#authpassword_reset) </Table.Cell> <Table.Cell> Emitted when a reset password token is generated. You can listen to this event to send a reset password email to the user or customer, for example. </Table.Cell> </Table.Row> </Table.Body> </Table>

<EventHeader headerLvl="2" headerProps={{ id: "authpassword_reset", children: (<>auth.password_reset</>), className: "flex flex-wrap justify-center gap-docs_0.25" }} eventName="auth.password_reset" payload={\``ts { entity_id, // The identifier of the user or customer. For example, an email address. actor_type, // The type of actor. For example, "customer", "user", or custom. token, // The generated token. metadata, // Optional custom metadata passed from the request. } ````} />

Emitted when a reset password token is generated. You can listen to this event to send a reset password email to the user or customer, for example.

Payload

ts
{
  entity_id, // The identifier of the user or customer. For example, an email address.
  actor_type, // The type of actor. For example, "customer", "user", or custom.
  token, // The generated token.
  metadata, // Optional custom metadata passed from the request.
}

Workflows Emitting this Event

The following workflows emit this event when they're executed. These workflows are executed by Medusa's API routes. You can also view the events emitted by API routes in the Store and Admin API references.