Skip to content

Commit deb9925

Browse files
committed
fix(passport): allow custom query params in the initial authenticate() invocation
1 parent 9638cf2 commit deb9925

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/passport.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,9 @@ export class Strategy implements passport.Strategy {
438438
const currentUrl = this.currentUrl(req)
439439

440440
if (
441-
(req.method === 'GET' && currentUrl.searchParams.size === 0) ||
442-
(currentUrl.searchParams.size === 1 && currentUrl.searchParams.has('iss'))
441+
req.method === 'GET' &&
442+
!currentUrl.searchParams.has('code') &&
443+
!currentUrl.searchParams.has('error')
443444
) {
444445
Strategy.prototype.authorizationRequest.call(this, req, options)
445446
} else {

0 commit comments

Comments
 (0)