Skip to main content

mercato auth set-password

yarn mercato auth set-password updates the stored bcrypt hash for the specified user.

Usage

yarn mercato auth set-password --email "<user@email>" --password "<newPassword>"

Behavior

  • Looks up the user by email.
  • Hashes the supplied password with bcryptjs (cost 10).
  • Persists the new hash and confirms the user.
  • Prints a success message such as ✅ Password updated successfully for user: user@example.com.

Troubleshooting

  • User not found – verify the email address, or list users with mercato auth list-users.
  • Weak passwords – the CLI does not enforce complexity, but downstream authentication may. Choose strong secrets manually.
  • Reused passwords – hashing is idempotent; rerunning the command with the same password is safe.