modificaciones sobre .env

This commit is contained in:
2025-10-22 13:44:11 -06:00
parent f06decdc43
commit 4427804865
4 changed files with 17 additions and 20 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ export class JwtStrategy extends PassportStrategy(Strategy) {
constructor() {
super({
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
secretOrKey: process.env.JWT_SECRET,
secretOrKey: process.env.JWT,
});
}
-4
View File
@@ -90,10 +90,6 @@ export class ProgramaService {
fecha_recibido: new Date(),
};
if (!process.env.TOKEN_GMAIL) {
throw new Error('No existe el token');
}
try {
responsable = await this.usuarioRepo.save(responsable);
-4
View File
@@ -230,10 +230,6 @@ export class ServicioService {
adjuntos: undefined,
};
if (!process.env.TOKEN_GMAIL) {
throw new Error('No existe el token');
}
if (servicio.correo) {
await this.gmailService.enviarCorreo(sendCorreoAlumnoDto);
}
+16 -11
View File
@@ -59,17 +59,22 @@ export class UsuarioService {
async escolares(numeroDeCuenta: string) {
let response;
try {
response = await axios.post(
`${process.env.ESCOLARES}${numeroDeCuenta}`,
{ password: process.env.ESCOLARES_PASS },
{
headers: {
'Content-Type': 'application/json', // Tipo de contenido
Authorization: `Bearer ${process.env.API_TOKEN}`, // Header de auth
},
},
);
if (process.env.MODE == 'pruebas') {
response = new Promise((res) => {
res({
data: {
nombre: 'nombre',
carrconst: 'Carrera',
avance: '80',
},
});
});
} else {
response = await axios.post(
`${process.env.ESCOLARES}${numeroDeCuenta}`,
{ password: process.env.ESCOLARES_PASS },
);
}
} catch (error) {
throw new UnauthorizedException(
'No se pudo conectar con el servicio de escolares',