Skip to content

Commit

Permalink
fix(admin-service): two competing admin service both hasing password …
Browse files Browse the repository at this point in the history
…creating connection problems
  • Loading branch information
LeoAnesi committed Dec 19, 2021
1 parent 1ae3298 commit e67fb63
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/adminUser/adminUser.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const adminUserCredentialValidator = {
TypeOrmModule.forFeature([AdminUserEntity]),
AdminAuthModuleFactory.createAdminAuthModule({
credentialValidator: adminUserCredentialValidator,
providers: [AdminUserService],
imports: [AdminUserModule]
}),
],
exports: [AdminAuthModuleFactory, AdminUserService],
Expand Down
2 changes: 1 addition & 1 deletion src/adminUser/adminUser.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class AdminUserService implements EntitySubscriberInterface<AdminUser> {
return compareSync(password, adminUser.password);
}

beforeInsert(event: InsertEvent<AdminUser>) {
beforeInsert(event: InsertEvent<AdminUser & { hasPasswordBeenHashed?: boolean }>) {
event.entity.password = this.hashPassword(event.entity.password);
}
beforeUpdate(event: UpdateEvent<AdminUser>) {
Expand Down

0 comments on commit e67fb63

Please sign in to comment.