[PR #1182] [CLOSED] fix: refresh login options when OIDC client is re-initialized #15575

Closed
opened 2026-05-24 16:48:37 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/moghtech/komodo/pull/1182
Author: @litlmike
Created: 2/8/2026
Status: Closed

Base: mainHead: fix-issue-1022


📝 Commits (1)

  • 0eaf8b5 fix: refresh login options when OIDC client is re-initialized

📊 Changes

2 files changed (+12 additions, -16 deletions)

View changed files

📝 bin/core/src/api/auth.rs (+11 -16)
📝 frontend/src/lib/hooks.ts (+1 -0)

📄 Description

Problem

When OIDC configuration is changed and re-initialized at runtime, the UI doesn't reflect the new state — users see stale OIDC buttons or missing login options, requiring a hard browser refresh.

Root Cause

The GetLoginOptions API response was cached in a OnceLock, computed once at server startup and never updated. The OIDC client itself uses ArcSwap for dynamic updates, but the login options endpoint returned the stale cached snapshot.

Fix

Backend: Replace the static OnceLock cache with a function that reads the current OIDC client state on each request. The oidc_client().load().is_some() check now reflects the live ArcSwap value.

Frontend: Add a 30-second polling interval to the login options query so the login page automatically picks up server-side changes without requiring a hard refresh.

Fixes #1022


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/moghtech/komodo/pull/1182 **Author:** [@litlmike](https://github.com/litlmike) **Created:** 2/8/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix-issue-1022` --- ### 📝 Commits (1) - [`0eaf8b5`](https://github.com/moghtech/komodo/commit/0eaf8b5f01e50d3887ce92991acaf98e7da91381) fix: refresh login options when OIDC client is re-initialized ### 📊 Changes **2 files changed** (+12 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `bin/core/src/api/auth.rs` (+11 -16) 📝 `frontend/src/lib/hooks.ts` (+1 -0) </details> ### 📄 Description ## Problem When OIDC configuration is changed and re-initialized at runtime, the UI doesn't reflect the new state — users see stale OIDC buttons or missing login options, requiring a hard browser refresh. ## Root Cause The `GetLoginOptions` API response was cached in a `OnceLock`, computed once at server startup and never updated. The OIDC client itself uses `ArcSwap` for dynamic updates, but the login options endpoint returned the stale cached snapshot. ## Fix **Backend:** Replace the static `OnceLock` cache with a function that reads the current OIDC client state on each request. The `oidc_client().load().is_some()` check now reflects the live `ArcSwap` value. **Frontend:** Add a 30-second polling interval to the login options query so the login page automatically picks up server-side changes without requiring a hard refresh. Fixes #1022 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-24 16:48:38 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/komodo#15575