File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
src/runtime/server/lib/oauth Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,12 @@ export interface OAuthOidcConfig {
3636 * @default process.env.NUXT_OAUTH_OIDC_REDIRECT_URL
3737 */
3838 redirectURL ?: string
39+ /**
40+ * Additional custom parameters that are passed to the specific endpoint requests.
41+ * Can be used to provide custom (query) parameters.
42+ */
43+ parameters ?: Partial < Record < 'authorization_endpoint' | 'token_endpoint' | 'userinfo_endpoint' , object > >
44+
3945}
4046
4147/**
@@ -266,6 +272,7 @@ export function defineOAuthOidcEventHandler<TUser = OidcUser>({ config, onSucces
266272 response_type : 'code' ,
267273 code_challenge : verifier . code_challenge ,
268274 code_challenge_method : verifier . code_challenge_method ,
275+ ...config . parameters ?. authorization_endpoint ,
269276 } ) ,
270277 )
271278 }
@@ -281,6 +288,7 @@ export function defineOAuthOidcEventHandler<TUser = OidcUser>({ config, onSucces
281288 redirect_uri : redirectURL ,
282289 code : query . code ,
283290 code_verifier : verifier . code_verifier ,
291+ ...config . parameters ?. token_endpoint ,
284292 } ,
285293 } )
286294
@@ -296,6 +304,7 @@ export function defineOAuthOidcEventHandler<TUser = OidcUser>({ config, onSucces
296304 headers : {
297305 Authorization : `${ tokens . token_type } ${ tokens . access_token } ` ,
298306 } ,
307+ body : config . parameters ?. userinfo_endpoint ,
299308 } )
300309 }
301310
You can’t perform that action at this time.
0 commit comments