API

Email and password management

9 files0 packages1 dependency

This pack adds account endpoints where signed-in users manage their own account as JSON. They update their name and email, and change their password, as a signed-in user against your existing authenticated routes.

  • A pending email change is reverted through the profile endpoint and resent through the email-verification endpoint of the auth pack. The account keeps signing in with its confirmed address until then.
  • A branded, MJML change-email message that links to your frontend and names both the old and the new address.
  • A new email and a new password meet the same rules as signup.

Depends on Auth

This pack extends the auth pack's User model and reuses its email-verification flow. Apply the auth pack first.

Apply the email & password management pack with Flow. Start a new session in your selected coding agent and execute the following slash command inside it.

$ npx @adonisplus/flow apply --pack=email-password-management --agent=claude

After applying, Flow will make the following changes to your app.

  • Land the backend as shipped, from the profile and account-password controllers through the validators, the change-email mailer and template, and the resend branch.
  • Add the profile and password endpoints to your existing authenticated account group.
  • Run the tests, then drive the endpoints as a signed-in user and show you the result.