mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-17 12:16:56 +02:00
Fix password updates for administrators in production environments
Correctly import the production authentication module with the `.js` extension to resolve the ERR_MODULE_NOT_FOUND error. Replit-Commit-Author: Agent Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/5WAXLXf
This commit is contained in:
1 parent
91ae0bebe7
commit
f42a999b61
3 files changed
+9
-3
No files matched your search
+2
-2
@@ -888,7 +888,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
||||
// 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<Server> {
|
||||
// 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
|
||||
|
||||
Reference in new issue
Block a user