Skip to content

🪵 refactor: Improve OpenID redirect origin handling and startup logs#50

Merged
danny-avila merged 2 commits into
mainfrom
chore/improve-logging
May 11, 2026
Merged

🪵 refactor: Improve OpenID redirect origin handling and startup logs#50
danny-avila merged 2 commits into
mainfrom
chore/improve-logging

Conversation

@danny-avila
Copy link
Copy Markdown
Contributor

Summary

  • Derive the admin panel origin from request headers for OpenID redirect and exchange flows so non-default ports/proxies round-trip correctly.
  • Add OpenID availability check warnings so hidden SSO states expose the failed URL/status/error.
  • Log the actual bound server port and emit the optional metrics-secret warning after startup succeeds.

Test plan

  • Ran bun run build.
  • Checked linter diagnostics for edited files.
  • Manually verified the OpenID check failure now logs the certificate error.

- 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.
- 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.
@danny-avila danny-avila changed the title Improve OpenID redirect origin handling and startup logs 🪵 refactor: Improve OpenID redirect origin handling and startup logs May 11, 2026
@danny-avila danny-avila merged commit 002d838 into main May 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants