Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

support static query params in the callback URLs

Kiran Kd254d434d1d3
diff --git a/apps/web/app/api/oauth/authorize/route.ts b/apps/web/app/api/oauth/authorize/route.ts
index dccb34ae77..841bcf5c07 100644
--- a/apps/web/app/api/oauth/authorize/route.ts
+++ b/apps/web/app/api/oauth/authorize/route.ts
@@ -58,13 +58,17 @@ export const POST = withWorkspace(async ({ session, req, workspace }) => {
},
});
- const searchParams = new URLSearchParams({
- code,
- ...(state && { state }),
- });
+ // Generate the callback URL
+ const callbackUrl = new URL(redirectUri);
+
+ callbackUrl.searchParams.set("code", code);
+
+ if (state) {
+ callbackUrl.searchParams.set("state", state);
+ }
const response = {
- callbackUrl: `${redirectUri}?${searchParams.toString()}`,
+ callbackUrl: callbackUrl.toString(),
};
return NextResponse.json(response);