Skip to content

Commit 264db00

Browse files
committed
feat(passport): easier way to use login_hint without overloads
1 parent af0f9d6 commit 264db00

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
@@ -32,6 +32,12 @@ export interface AuthenticateOptions extends passport.AuthenticateOptions {
3232
*/
3333
resource?: string | string[]
3434

35+
/**
36+
* Login Hint to use for the authorization request. It is ignored for token
37+
* endpoint requests.
38+
*/
39+
loginHint?: string
40+
3541
/**
3642
* OAuth 2.0 Rich Authorization Requests to use for the authorization request.
3743
* It is ignored for token endpoint requests.
@@ -250,6 +256,10 @@ export class Strategy implements passport.Strategy {
250256
params.set('prompt', options.prompt)
251257
}
252258

259+
if (options?.loginHint) {
260+
params.set('login_hint', options.loginHint)
261+
}
262+
253263
if (options?.resource) {
254264
setResource(params, options.resource)
255265
}

0 commit comments

Comments
 (0)