The documentation is not clear for me and I need to validate the parameters data to define if the user is allowed to get his login or not, I am using express too, so I'm so confused with expressApp.use () and provider.use(). Simply, I need to mix this functions and that it serve because I can't use those functions separated due to the .use() method from express that avoid it to me.
// Ruta principal para la conexión y obtener el documento de descubrimiento
expressApp.use("/oidc", async (err, req, res, next) => {
console.log('PRE-MIDDLEWARE');
console.log(req, res)
if (err instanceof SessionNotFound)
return res.render('expiredSession', {})
if (err) {
console.log(err);
return next(err);
}
}, oidc.callback());
oidc.use(async (ctx, next) => {
console.log('pre middleware', ctx.method, ctx.path);
});
I'll appreciate your help