From 3b2d570eb8bc385899147cdc39e3d4b10e611f00 Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Wed, 27 Nov 2024 18:07:31 +0100 Subject: [PATCH] fix(passport): fix currentUrl when using express.Router closes #733 --- src/passport.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/passport.ts b/src/passport.ts index d9840830..788bd318 100644 --- a/src/passport.ts +++ b/src/passport.ts @@ -384,7 +384,7 @@ export class Strategy implements passport.Strategy { * `redirect_uri` authorization code grant token endpoint parameter */ currentUrl(req: express.Request): URL { - return new URL(`${req.protocol}://${req.host}${req.url}`) + return new URL(`${req.protocol}://${req.host}${req.originalUrl ?? req.url}`) } authenticate<