mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +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)
|
@Inject(InvitationRepository)
|
||||||
readonly repository: InvitationRepository,
|
readonly repository: InvitationRepository,
|
||||||
@Inject(JwtService) private readonly jwtService: JwtService,
|
@Inject(JwtService) private readonly jwtService: JwtService,
|
||||||
@Optional() private readonly mailerService: MailerService | undefined,
|
|
||||||
private logger: LoggerService,
|
private logger: LoggerService,
|
||||||
protected readonly i18n: I18nService,
|
protected readonly i18n: I18nService,
|
||||||
public readonly languageService: LanguageService,
|
public readonly languageService: LanguageService,
|
||||||
|
@Optional() private readonly mailerService?: MailerService,
|
||||||
) {
|
) {
|
||||||
super(repository);
|
super(repository);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,11 +32,11 @@ import { UserService } from './user.service';
|
|||||||
export class PasswordResetService {
|
export class PasswordResetService {
|
||||||
constructor(
|
constructor(
|
||||||
@Inject(JwtService) private readonly jwtService: JwtService,
|
@Inject(JwtService) private readonly jwtService: JwtService,
|
||||||
@Optional() private readonly mailerService: MailerService | undefined,
|
|
||||||
private logger: LoggerService,
|
private logger: LoggerService,
|
||||||
private readonly userService: UserService,
|
private readonly userService: UserService,
|
||||||
public readonly i18n: I18nService,
|
public readonly i18n: I18nService,
|
||||||
public readonly languageService: LanguageService,
|
public readonly languageService: LanguageService,
|
||||||
|
@Optional() private readonly mailerService: MailerService,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public readonly jwtSignOptions: JwtSignOptions = {
|
public readonly jwtSignOptions: JwtSignOptions = {
|
||||||
@ -105,7 +105,7 @@ export class PasswordResetService {
|
|||||||
// first step is to check if the token has been used
|
// first step is to check if the token has been used
|
||||||
const user = await this.userService.findOne({ email: payload.email });
|
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');
|
throw new UnauthorizedException('Invalid token');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -36,10 +36,10 @@ export class ValidateAccountService {
|
|||||||
constructor(
|
constructor(
|
||||||
@Inject(JwtService) private readonly jwtService: JwtService,
|
@Inject(JwtService) private readonly jwtService: JwtService,
|
||||||
private readonly userService: UserService,
|
private readonly userService: UserService,
|
||||||
@Optional() private readonly mailerService: MailerService | undefined,
|
|
||||||
private logger: LoggerService,
|
private logger: LoggerService,
|
||||||
private readonly i18n: I18nService,
|
private readonly i18n: I18nService,
|
||||||
private readonly languageService: LanguageService,
|
private readonly languageService: LanguageService,
|
||||||
|
@Optional() private readonly mailerService?: MailerService,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user