Skip to content

Commit

Permalink
fix(passport): fix currentUrl when using express.Router
Browse files Browse the repository at this point in the history
closes #733
  • Loading branch information
panva committed Nov 27, 2024
1 parent ce5140e commit 3b2d570
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/passport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<
Expand Down

0 comments on commit 3b2d570

Please sign in to comment.