Skip to content

Commit 146b5d5

Browse files
committed
fix(email): local handlers wouldn't initialize email variable, when module was available
1 parent 9778f74 commit 146b5d5

File tree

1 file changed

+2
-8
lines changed
  • modules/authentication/src/handlers

1 file changed

+2
-8
lines changed

modules/authentication/src/handlers/local.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isNil } from 'lodash-es';
1+
import { isNil, merge } from 'lodash-es';
22
import { AuthUtils } from '../utils/index.js';
33
import { TokenType } from '../constants/index.js';
44
import { v4 as uuid } from 'uuid';
@@ -24,7 +24,6 @@ import {
2424
RoutingManager,
2525
} from '@conduitplatform/module-tools';
2626
import { createHash } from 'crypto';
27-
import { merge } from 'lodash-es';
2827
import { authenticateChecks, changePassword } from './utils.js';
2928

3029
export class LocalHandlers implements IAuthenticationStrategy {
@@ -710,13 +709,8 @@ export class LocalHandlers implements IAuthenticationStrategy {
710709
}
711710

712711
private async initDbAndEmail() {
713-
const config = ConfigController.getInstance().config;
714-
715-
if (config.local.verification.send_email && this.grpcSdk.isAvailable('email')) {
712+
if (this.grpcSdk.isAvailable('email')) {
716713
this.emailModule = this.grpcSdk.emailProvider!;
717-
}
718-
719-
if (config.local.verification.send_email && this.grpcSdk.isAvailable('email')) {
720714
this.registerTemplates();
721715
}
722716
this.initialized = true;

0 commit comments

Comments
 (0)