diff --git a/src/runtime/server/lib/oauth/google.ts b/src/runtime/server/lib/oauth/google.ts index 1f1ac4f..6c943d3 100644 --- a/src/runtime/server/lib/oauth/google.ts +++ b/src/runtime/server/lib/oauth/google.ts @@ -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) @@ -89,6 +89,7 @@ export function defineOAuthGoogleEventHandler({ client_id: config.clientId, redirect_uri: redirectURL, scope: config.scope.join(' '), + state: query.state || '', ...config.authorizationParams, }), )