0

ドキュメントは私にとって明確ではなく、パラメーターデータを検証して、ユーザーがログインを許可されているかどうかを定義する必要があります。私もエクスプレスを使用しているため、expressApp.use () とプロバイダーと非常に混同しています。使用する()。簡単に言えば、私はこの関数を混合する必要があり、それを回避するエクスプレスから .use() メソッドのために分離された関数を使用できないため、それが機能する必要があります。

    // 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);
    });

私はあなたの助けに感謝します

4

0 に答える 0