@loomcore/api 0.1.65 → 0.1.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -56,7 +56,13 @@ export class MigrationRunner {
|
|
|
56
56
|
throw new Error(`❌ Migrations directory not found at: ${this.migrationsDir}`);
|
|
57
57
|
}
|
|
58
58
|
if (this.dbType === 'postgres') {
|
|
59
|
-
const pool = new Pool({
|
|
59
|
+
const pool = new Pool({
|
|
60
|
+
host: this.config.database.host,
|
|
61
|
+
user: this.config.database.username,
|
|
62
|
+
password: this.config.database.password,
|
|
63
|
+
port: this.config.database.port,
|
|
64
|
+
database: this.config.database.name
|
|
65
|
+
});
|
|
60
66
|
this.dbConnection = pool;
|
|
61
67
|
return new Umzug({
|
|
62
68
|
migrations: async () => {
|
|
@@ -158,7 +164,13 @@ export class MigrationRunner {
|
|
|
158
164
|
async wipeDatabase() {
|
|
159
165
|
console.log(`⚠️ Wiping ${this.dbType} database...`);
|
|
160
166
|
if (this.dbType === 'postgres') {
|
|
161
|
-
const pool = new Pool({
|
|
167
|
+
const pool = new Pool({
|
|
168
|
+
host: this.config.database.host,
|
|
169
|
+
user: this.config.database.username,
|
|
170
|
+
password: this.config.database.password,
|
|
171
|
+
port: this.config.database.port,
|
|
172
|
+
database: this.config.database.name
|
|
173
|
+
});
|
|
162
174
|
try {
|
|
163
175
|
await pool.query('DROP SCHEMA public CASCADE; CREATE SCHEMA public;');
|
|
164
176
|
}
|
|
@@ -189,7 +189,7 @@ export class AuthService extends MultiTenantApiService {
|
|
|
189
189
|
}
|
|
190
190
|
const validationErrors = entityUtils.validate(passwordValidator, { password: password });
|
|
191
191
|
entityUtils.handleValidationResult(validationErrors, 'AuthService.resetPassword');
|
|
192
|
-
const result = await this.changePassword(
|
|
192
|
+
const result = await this.changePassword(getSystemUserContext(), { email: lowerCaseEmail }, password);
|
|
193
193
|
console.log(`password changed using forgot-password for email: ${lowerCaseEmail}`);
|
|
194
194
|
await this.passwordResetTokenService.deleteById(EmptyUserContext, retrievedPasswordResetToken._id.toString());
|
|
195
195
|
console.log(`passwordResetToken deleted for email: ${lowerCaseEmail}`);
|