Commit 002d838
authored
🪵 refactor: Improve OpenID redirect origin handling and startup logs (#50)
* refactor: Improve request origin handling and restore metrics warning
- Added a new function to extract the request origin from headers, enhancing cross-origin request handling.
- Updated OpenID check and login functions to utilize the new origin extraction logic.
- Restored the warning for unset ADMIN_PANEL_METRICS_SECRET, ensuring visibility for metrics endpoint access issues.
- Refactored server initialization to log the correct port number.
* refactor: request origin extraction for improved security
- Introduced a new function to reliably extract the request origin from headers, improving handling of cross-origin requests.
- Updated OpenID login and OAuth exchange functions to utilize the new origin extraction logic, ensuring correct redirect URIs.
- Removed redundant origin handling code, streamlining the request processing flow.1 parent 2928b61 commit 002d838
2 files changed
Lines changed: 38 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | 39 | | |
44 | 40 | | |
45 | 41 | | |
| |||
51 | 47 | | |
52 | 48 | | |
53 | 49 | | |
54 | | - | |
| 50 | + | |
55 | 51 | | |
56 | 52 | | |
57 | 53 | | |
| |||
72 | 68 | | |
73 | 69 | | |
74 | 70 | | |
75 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
24 | 44 | | |
25 | 45 | | |
26 | 46 | | |
| |||
303 | 323 | | |
304 | 324 | | |
305 | 325 | | |
| 326 | + | |
306 | 327 | | |
307 | | - | |
308 | | - | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
309 | 333 | | |
310 | 334 | | |
311 | | - | |
| 335 | + | |
| 336 | + | |
312 | 337 | | |
313 | 338 | | |
314 | 339 | | |
| |||
317 | 342 | | |
318 | 343 | | |
319 | 344 | | |
| 345 | + | |
320 | 346 | | |
321 | | - | |
322 | 347 | | |
323 | 348 | | |
324 | 349 | | |
| 350 | + | |
325 | 351 | | |
326 | 352 | | |
327 | 353 | | |
| |||
340 | 366 | | |
341 | 367 | | |
342 | 368 | | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
| 369 | + | |
| 370 | + | |
351 | 371 | | |
352 | | - | |
353 | 372 | | |
354 | 373 | | |
355 | 374 | | |
| |||
0 commit comments