mirror of
https://github.com/hexastack/hexabot
synced 2025-01-22 18:45:57 +00:00
fix: adapt services constructors
This commit is contained in:
parent
816db9817a
commit
5bb4668a01
@ -39,10 +39,10 @@ export class InvitationService extends BaseService<
|
||||
@Inject(InvitationRepository)
|
||||
readonly repository: InvitationRepository,
|
||||
@Inject(JwtService) private readonly jwtService: JwtService,
|
||||
@Optional() private readonly mailerService: MailerService | undefined,
|
||||
private logger: LoggerService,
|
||||
protected readonly i18n: I18nService,
|
||||
public readonly languageService: LanguageService,
|
||||
@Optional() private readonly mailerService?: MailerService,
|
||||
) {
|
||||
super(repository);
|
||||
}
|
||||
|
@ -32,11 +32,11 @@ import { UserService } from './user.service';
|
||||
export class PasswordResetService {
|
||||
constructor(
|
||||
@Inject(JwtService) private readonly jwtService: JwtService,
|
||||
@Optional() private readonly mailerService: MailerService | undefined,
|
||||
private logger: LoggerService,
|
||||
private readonly userService: UserService,
|
||||
public readonly i18n: I18nService,
|
||||
public readonly languageService: LanguageService,
|
||||
@Optional() private readonly mailerService: MailerService,
|
||||
) {}
|
||||
|
||||
public readonly jwtSignOptions: JwtSignOptions = {
|
||||
@ -105,7 +105,7 @@ export class PasswordResetService {
|
||||
// first step is to check if the token has been used
|
||||
const user = await this.userService.findOne({ email: payload.email });
|
||||
|
||||
if (!user.resetToken || compareSync(user.resetToken, token)) {
|
||||
if (!user?.resetToken || compareSync(user.resetToken, token)) {
|
||||
throw new UnauthorizedException('Invalid token');
|
||||
}
|
||||
|
||||
|
@ -36,10 +36,10 @@ export class ValidateAccountService {
|
||||
constructor(
|
||||
@Inject(JwtService) private readonly jwtService: JwtService,
|
||||
private readonly userService: UserService,
|
||||
@Optional() private readonly mailerService: MailerService | undefined,
|
||||
private logger: LoggerService,
|
||||
private readonly i18n: I18nService,
|
||||
private readonly languageService: LanguageService,
|
||||
@Optional() private readonly mailerService?: MailerService,
|
||||
) {}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user