Se agregó módulo de sistemas
This commit is contained in:
@@ -30,24 +30,24 @@ export class MailController {
|
||||
@Post('send')
|
||||
@ApiSendMail()
|
||||
async sendMail(
|
||||
@Headers() headers:{password:string},
|
||||
@Headers() headers:{token:string},
|
||||
@Body() body: { to: string; subject: string; text: string; fecha_recibido: Date, html:string, adjuntos:any }) {
|
||||
|
||||
/*
|
||||
|
||||
|
||||
// esta parte hay que rehacerla, se tiene que obtener la contraseña del sistema en base a la clave del sistema.
|
||||
// debe de existir un modulo para crear contraseñas para las apis y administrar esas contraseñas
|
||||
|
||||
|
||||
if (!headers.password) {
|
||||
if (!headers.token) {
|
||||
throw new UnauthorizedException('Header "Password" es requerido');
|
||||
}
|
||||
|
||||
const sistem = await this.sistemaRepository.findOne({ where: { password: headers.password } });
|
||||
const sistem = await this.sistemaRepository.findOne({ where: { token: headers.token } });
|
||||
|
||||
if (!sistem) {
|
||||
throw new UnauthorizedException('Password incorrecto');
|
||||
} */
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ export class MailController {
|
||||
throw new UnauthorizedException('Header "Password" es requerido');
|
||||
}
|
||||
|
||||
const sistem = await this.sistemaRepository.findOne({ where: { password: headers.password } });
|
||||
const sistem = await this.sistemaRepository.findOne({ where: { token: headers.password } });
|
||||
|
||||
if (!sistem) {
|
||||
throw new UnauthorizedException('Password incorrecto');
|
||||
|
||||
Reference in New Issue
Block a user