Skip to content

Commit 3286953

Browse files
feat: add support for authorization parameters and ensure state param is included from query when present in Facebook & Microsoft OAuth (#386)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 6c2cb93 commit 3286953

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/runtime/server/lib/oauth/facebook.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export interface OAuthFacebookConfig {
5151
*/
5252
authorizationParams?: Record<string, string>
5353
/**
54-
* Redirect URL to to allow overriding for situations like prod failing to determine public hostname
54+
* Redirect URL to allow overriding for situations like prod failing to determine public hostname
5555
* @default process.env.NUXT_OAUTH_FACEBOOK_REDIRECT_URL or current URL
5656
*/
5757
redirectURL?: string
@@ -96,6 +96,8 @@ export function defineOAuthFacebookEventHandler({
9696
client_id: config.clientId,
9797
redirect_uri: redirectURL,
9898
scope: config.scope.join(' '),
99+
state: query.state || '',
100+
...config.authorizationParams,
99101
}),
100102
)
101103
}

src/runtime/server/lib/oauth/microsoft.ts

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ export function defineOAuthMicrosoftEventHandler({ config, onSuccess, onError }:
8888
response_type: 'code',
8989
redirect_uri: redirectURL,
9090
scope: config.scope.join(' '),
91+
state: query.state || '',
9192
...config.authorizationParams,
9293
}),
9394
)

0 commit comments

Comments
 (0)