File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,10 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
9
9
const distPath = join ( __dirname , "../dist" ) ;
10
10
11
11
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
+ } ) ;
13
16
} ) ;
14
17
15
18
const port = process . env . PORT || 5173 ;
Original file line number Diff line number Diff line change @@ -86,9 +86,9 @@ export async function handleOAuthCallback(
86
86
const response = await fetch ( metadata . token_endpoint , {
87
87
method : "POST" ,
88
88
headers : {
89
- "Content-Type" : "application/json " ,
89
+ "Content-Type" : "application/x-www-form-urlencoded " ,
90
90
} ,
91
- body : JSON . stringify ( {
91
+ body : new URLSearchParams ( {
92
92
grant_type : "authorization_code" ,
93
93
code,
94
94
code_verifier : codeVerifier ,
@@ -117,9 +117,9 @@ export async function refreshAccessToken(
117
117
const response = await fetch ( metadata . token_endpoint , {
118
118
method : "POST" ,
119
119
headers : {
120
- "Content-Type" : "application/json " ,
120
+ "Content-Type" : "application/x-www-form-urlencoded " ,
121
121
} ,
122
- body : JSON . stringify ( {
122
+ body : new URLSearchParams ( {
123
123
grant_type : "refresh_token" ,
124
124
refresh_token : refreshToken ,
125
125
} ) ,
You can’t perform that action at this time.
0 commit comments