Skip to content

Commit

Permalink
chore: add state params in Google oauth
Browse files Browse the repository at this point in the history
  • Loading branch information
julianfox authored Sep 30, 2024
1 parent 0c4d050 commit f75e680
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/runtime/server/lib/oauth/google.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function defineOAuthGoogleEventHandler({
authorizationParams: {},
}) as OAuthGoogleConfig

const query = getQuery<{ code?: string }>(event)
const query = getQuery<{ code?: string, state?: string }>(event)

if (!config.clientId) {
return handleMissingConfiguration(event, 'google', ['clientId'], onError)
Expand All @@ -89,6 +89,7 @@ export function defineOAuthGoogleEventHandler({
client_id: config.clientId,
redirect_uri: redirectURL,
scope: config.scope.join(' '),
state: query.state || '',
...config.authorizationParams,
}),
)
Expand Down

0 comments on commit f75e680

Please sign in to comment.