🔐 Enhanced password hashing for MedusaJS using the Argon2 algorithm - the most advanced and secure password hashing method.
🔐 Enhanced password hashing for MedusaJS using the Argon2 algorithm - the most advanced and secure password hashing method.
Argon2 offers superior security compared to traditional hashing methods:
Install the package using npm:
npm install @vymalo/medusa-argon2
Or using yarn:
yarn add @vymalo/medusa-argon2
Add the plugin to the section of your MedusaJS configuration:
modules: [{resolve: '@medusajs/medusa/auth',options: {providers: [{resolve: '@vymalo/medusa-argon2',id: 'emailpass', // Yes, `emailpass`, as the goal is to override the defaultoptions: {// Optional configuration parametersargon2: {timeCost: 3,memoryCost: 12288, // 12 MBparallelism: 1}},},],},},// Other modules...]
The plugin supports full Argon2 configuration:
interface Argon2Options {hashLength?: number; // Length of the hash output (default: secure)timeCost?: number; // Number of iterations (higher = more secure)memoryCost?: number; // Memory usage in KB (higher = more secure)parallelism?: number; // Number of parallel threadstype?: 0 | 1 | 2; // Argon2 variant (d, i, or id)version?: number; // Argon2 version// Advanced optionssalt?: Buffer; // Custom salt (usually auto-generated)associatedData?: Buffer; // Additional context datasecret?: Buffer; // Secret key for additional security}
Contributions are welcome! Please submit pull requests or open issues.
If you discover a security vulnerability, please send an email to [your security contact].