Skip to content

Commit b4870b3

Browse files
authored
Merge branch 'main' into feature/completions
2 parents 5063880 + e28a64c commit b4870b3

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

client/bin/cli.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
99
const distPath = join(__dirname, "../dist");
1010

1111
const server = http.createServer((request, response) => {
12-
return handler(request, response, { public: distPath });
12+
return handler(request, response, {
13+
public: distPath,
14+
rewrites: [{ source: "/**", destination: "/index.html" }],
15+
});
1316
});
1417

1518
const port = process.env.PORT || 5173;

client/src/lib/auth.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ export async function handleOAuthCallback(
8686
const response = await fetch(metadata.token_endpoint, {
8787
method: "POST",
8888
headers: {
89-
"Content-Type": "application/json",
89+
"Content-Type": "application/x-www-form-urlencoded",
9090
},
91-
body: JSON.stringify({
91+
body: new URLSearchParams({
9292
grant_type: "authorization_code",
9393
code,
9494
code_verifier: codeVerifier,
@@ -117,9 +117,9 @@ export async function refreshAccessToken(
117117
const response = await fetch(metadata.token_endpoint, {
118118
method: "POST",
119119
headers: {
120-
"Content-Type": "application/json",
120+
"Content-Type": "application/x-www-form-urlencoded",
121121
},
122-
body: JSON.stringify({
122+
body: new URLSearchParams({
123123
grant_type: "refresh_token",
124124
refresh_token: refreshToken,
125125
}),

0 commit comments

Comments
 (0)