File tree 1 file changed +6
-10
lines changed
1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -274,17 +274,13 @@ export const getCookieOptions = (req: express.Request): express.CookieOptions =>
274
274
// When logging in or out the request must include the href (the full current
275
275
// URL of that page) and the relative path to the root as given to it by the
276
276
// backend. Using these two we can determine the true absolute root.
277
- let domain = req . headers . host || ""
278
- let pathname = "/"
279
- const href = req . query . href || req . body . href
280
- if ( href ) {
281
- const url = new URL ( req . query . base || req . body . base || "/" , href )
282
- domain = url . host
283
- pathname = url . pathname
284
- }
277
+ const url = new URL (
278
+ req . query . base || req . body . base || "/" ,
279
+ req . query . href || req . body . href || "http://" + ( req . headers . host || "localhost" ) ,
280
+ )
285
281
return {
286
- domain : getCookieDomain ( domain , req . args [ "proxy-domain" ] ) ,
287
- path : normalize ( pathname ) || "/" ,
282
+ domain : getCookieDomain ( url . host , req . args [ "proxy-domain" ] ) ,
283
+ path : normalize ( url . pathname ) || "/" ,
288
284
sameSite : "lax" ,
289
285
}
290
286
}
You can’t perform that action at this time.
0 commit comments