diff --git a/attached_assets/image_1754941049134.png b/attached_assets/image_1754941049134.png new file mode 100644 index 0000000..a910360 Binary files /dev/null and b/attached_assets/image_1754941049134.png differ diff --git a/replit.md b/replit.md index 97ce338..52b91df 100644 --- a/replit.md +++ b/replit.md @@ -133,4 +133,10 @@ Preferred communication style: Simple, everyday language. #### Email Field Consistency in Edit Form - **Issue**: Email field was marked as required in edit form but optional in create form - **Solution**: Removed `required` attribute and asterisk from email field in edit form -- **Result**: Email field now consistently optional in both create and edit forms \ No newline at end of file +- **Result**: Email field now consistently optional in both create and edit forms + +#### Production Password Hashing Fix +- **Issue**: Admin password changes failed in production with ERR_MODULE_NOT_FOUND for localAuth.production +- **Root Cause**: Dynamic imports in production needed `.js` extension for compiled files +- **Solution**: Updated import paths to use `./localAuth.production.js` for production environment +- **Result**: Password hashing now works correctly in production for user updates \ No newline at end of file diff --git a/server/routes.ts b/server/routes.ts index ca9e720..e503579 100644 --- a/server/routes.ts +++ b/server/routes.ts @@ -888,7 +888,7 @@ export async function registerRoutes(app: Express): Promise { // Hash password if provided (for local auth) if (userData.password) { // Import from the correct auth module based on environment - const authModule = process.env.NODE_ENV === 'production' ? "./localAuth.production" : "./localAuth"; + const authModule = process.env.NODE_ENV === 'production' ? "./localAuth.production.js" : "./localAuth"; const { hashPassword } = await import(authModule); userData.password = await hashPassword(userData.password); } @@ -946,7 +946,7 @@ export async function registerRoutes(app: Express): Promise { // Hash password if provided if (userData.password) { // Import from the correct auth module based on environment - const authModule = process.env.NODE_ENV === 'production' ? "./localAuth.production" : "./localAuth"; + const authModule = process.env.NODE_ENV === 'production' ? "./localAuth.production.js" : "./localAuth"; const { hashPassword } = await import(authModule); userData.password = await hashPassword(userData.password); // Mark password as changed