Skip to content

Commit afe24ae

Browse files
committed
feat(passport): easier way to use id_token_hint without overloads
1 parent c9f2993 commit afe24ae

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/passport.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ export interface AuthenticateOptions extends passport.AuthenticateOptions {
3838
*/
3939
loginHint?: string
4040

41+
/**
42+
* ID Token Hint to use for the authorization request. It is ignored for token
43+
* endpoint requests.
44+
*/
45+
idTokenHint?: string
46+
4147
/**
4248
* OAuth 2.0 Rich Authorization Requests to use for the authorization request.
4349
* It is ignored for token endpoint requests.
@@ -260,6 +266,10 @@ export class Strategy implements passport.Strategy {
260266
params.set('login_hint', options.loginHint)
261267
}
262268

269+
if (options?.idTokenHint) {
270+
params.set('id_token_hint', options.idTokenHint)
271+
}
272+
263273
if (options?.resource) {
264274
setResource(params, options.resource)
265275
}

0 commit comments

Comments
 (0)