diff --git a/.github/workflows/partial-frontend.yaml b/.github/workflows/partial-frontend.yaml index 43722d6ef..79788120f 100644 --- a/.github/workflows/partial-frontend.yaml +++ b/.github/workflows/partial-frontend.yaml @@ -19,6 +19,10 @@ jobs: with: fetch-depth: 0 + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 + with: + node-version: lts/* + - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 with: version: 10 diff --git a/backend/app/api/handlers/v1/controller.go b/backend/app/api/handlers/v1/controller.go index f9c5d3af3..f7e18ce4b 100644 --- a/backend/app/api/handlers/v1/controller.go +++ b/backend/app/api/handlers/v1/controller.go @@ -106,6 +106,7 @@ type ( ButtonText string `json:"buttonText,omitempty"` AutoRedirect bool `json:"autoRedirect,omitempty"` AllowLocal bool `json:"allowLocal"` + Initialized bool `json:"initialized"` } TelemetryStatus struct { @@ -166,6 +167,7 @@ func (ctrl *V1Controller) HandleBase(ready ReadyFunc, build Build) errchain.Hand ButtonText: ctrl.config.OIDC.ButtonText, AutoRedirect: ctrl.config.OIDC.AutoRedirect, AllowLocal: ctrl.config.Options.AllowLocalLogin, + Initialized: ctrl.oidcProvider != nil, }, Telemetry: TelemetryStatus{ Enabled: ctrl.config.Otel.Enabled, diff --git a/frontend/lib/api/types/data-contracts.ts b/frontend/lib/api/types/data-contracts.ts index 1a869f988..35605dcc2 100644 --- a/frontend/lib/api/types/data-contracts.ts +++ b/frontend/lib/api/types/data-contracts.ts @@ -1218,6 +1218,7 @@ export interface OIDCStatus { autoRedirect: boolean; buttonText: string; enabled: boolean; + initialized: boolean; } export interface TelemetryStatus { diff --git a/frontend/pages/index.vue b/frontend/pages/index.vue index 2044badfb..9303520e7 100644 --- a/frontend/pages/index.vue +++ b/frontend/pages/index.vue @@ -73,7 +73,13 @@ } // Auto-redirect to OIDC if autoRedirect is enabled, but not if there's an OIDC initialization error - if (status?.oidc?.enabled && status?.oidc?.autoRedirect && !oidcError.value && !shownErrorMessage.value) { + if ( + status?.oidc?.enabled && + status?.oidc?.initialized && + status?.oidc?.autoRedirect && + !oidcError.value && + !shownErrorMessage.value + ) { loginWithOIDC(); } }); @@ -384,7 +390,7 @@