Skip to content

Commit f75e680

Browse files
authored
chore: add state params in Google oauth
1 parent 0c4d050 commit f75e680

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export function defineOAuthGoogleEventHandler({
7272
authorizationParams: {},
7373
}) as OAuthGoogleConfig
7474

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

7777
if (!config.clientId) {
7878
return handleMissingConfiguration(event, 'google', ['clientId'], onError)
@@ -89,6 +89,7 @@ export function defineOAuthGoogleEventHandler({
8989
client_id: config.clientId,
9090
redirect_uri: redirectURL,
9191
scope: config.scope.join(' '),
92+
state: query.state || '',
9293
...config.authorizationParams,
9394
}),
9495
)

0 commit comments

Comments
 (0)