Skip to content

Commit b420d36

Browse files
ChrGrbndom91ThangHuuVu
authored
feat: Add form-post specification (#8428)
* Added check for response mode in callback * chore: lint --------- Co-authored-by: Nico Domino <[email protected]> Co-authored-by: Thang Vu <[email protected]>
1 parent 7e2c2d4 commit b420d36

File tree

1 file changed

+9
-2
lines changed
  • packages/core/src/lib/actions/callback

1 file changed

+9
-2
lines changed

packages/core/src/lib/actions/callback/index.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,15 @@ export async function callback(
5656

5757
try {
5858
if (provider.type === "oauth" || provider.type === "oidc") {
59+
// Use body if the response mode is set to form_post. For all other cases, use query
60+
const payload =
61+
provider.authorization?.url.searchParams.get("response_mode") ===
62+
"form_post"
63+
? body
64+
: query
65+
5966
const { proxyRedirect, randomState } = handleState(
60-
query,
67+
payload,
6168
provider,
6269
options.isOnRedirectProxy
6370
)
@@ -68,7 +75,7 @@ export async function callback(
6875
}
6976

7077
const authorizationResult = await handleOAuth(
71-
query,
78+
payload,
7279
request.cookies,
7380
options,
7481
randomState

0 commit comments

Comments
 (0)