modificaciones sobre .env
This commit is contained in:
@@ -7,7 +7,7 @@ export class JwtStrategy extends PassportStrategy(Strategy) {
|
||||
constructor() {
|
||||
super({
|
||||
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
|
||||
secretOrKey: process.env.JWT_SECRET,
|
||||
secretOrKey: process.env.JWT,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user