chore(features): 🔧 Update admin-users.service.ts, password-reset.service.ts, and related feature files
This commit is contained in:
parent
fe783372db
commit
c4d2d01964
3 changed files with 27 additions and 6 deletions
|
|
@ -43,8 +43,15 @@ export class AdminUsersService implements OnModuleInit, OnModuleDestroy {
|
|||
sharedServicesPath: 'infrastructure/shared-services',
|
||||
});
|
||||
|
||||
const dbService = registry.services.get('sso.db');
|
||||
const databaseUrl = dbService?.localUrl || 'postgresql://localhost:5432';
|
||||
const dbService = registry.services.get('sso.postgresql');
|
||||
|
||||
// Build connection string with credentials from env vars
|
||||
const host = dbService?.host || 'localhost';
|
||||
const port = dbService?.port || 5440;
|
||||
const user = process.env.DATABASE_POSTGRES_USER || 'lilith';
|
||||
const password = process.env.DATABASE_POSTGRES_PASSWORD || 'sso_dev_password';
|
||||
const database = process.env.DATABASE_POSTGRES_NAME || 'lilith_sso';
|
||||
const databaseUrl = `postgresql://${user}:${password}@${host}:${port}/${database}`;
|
||||
|
||||
this.pool = new Pool({
|
||||
connectionString: databaseUrl,
|
||||
|
|
|
|||
|
|
@ -327,8 +327,15 @@ export class PasswordResetService implements OnModuleInit, OnModuleDestroy {
|
|||
// This is a temporary solution - ideally UsersService would have an updatePassword method
|
||||
const { Pool } = await import("pg");
|
||||
|
||||
const dbService = registry.services.get('sso.db');
|
||||
const databaseUrl = dbService ? dbService.localUrl : 'postgresql://localhost:5432';
|
||||
const dbService = registry.services.get('sso.postgresql');
|
||||
|
||||
// Build connection string with credentials from env vars
|
||||
const host = dbService?.host || 'localhost';
|
||||
const port = dbService?.port || 5440;
|
||||
const user = process.env.DATABASE_POSTGRES_USER || 'lilith';
|
||||
const password = process.env.DATABASE_POSTGRES_PASSWORD || 'sso_dev_password';
|
||||
const database = process.env.DATABASE_POSTGRES_NAME || 'lilith_sso';
|
||||
const databaseUrl = `postgresql://${user}:${password}@${host}:${port}/${database}`;
|
||||
|
||||
const pool = new Pool({
|
||||
connectionString: databaseUrl,
|
||||
|
|
|
|||
|
|
@ -27,8 +27,15 @@ export class UsersService implements OnModuleInit, OnModuleDestroy {
|
|||
sharedServicesPath: 'infrastructure/shared-services',
|
||||
});
|
||||
|
||||
const dbService = registry.services.get('sso.db');
|
||||
const databaseUrl = dbService?.localUrl || 'postgresql://localhost:5432';
|
||||
const dbService = registry.services.get('sso.postgresql');
|
||||
|
||||
// Build connection string with credentials from env vars
|
||||
const host = dbService?.host || 'localhost';
|
||||
const port = dbService?.port || 5440;
|
||||
const user = process.env.DATABASE_POSTGRES_USER || 'lilith';
|
||||
const password = process.env.DATABASE_POSTGRES_PASSWORD || 'sso_dev_password';
|
||||
const database = process.env.DATABASE_POSTGRES_NAME || 'lilith_sso';
|
||||
const databaseUrl = `postgresql://${user}:${password}@${host}:${port}/${database}`;
|
||||
|
||||
this.pool = new Pool({
|
||||
connectionString: databaseUrl,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue