Skip to content

OIDC server-side token refresh#2160

Merged
lissy93 merged 6 commits into
masterfrom
fix/refresh-oidc-token
May 21, 2026
Merged

OIDC server-side token refresh#2160
lissy93 merged 6 commits into
masterfrom
fix/refresh-oidc-token

Conversation

@lissy93
Copy link
Copy Markdown
Owner

@lissy93 lissy93 commented May 21, 2026

Category

Bugfix

Overview

In #2153 (v4.1.8) we hardened the auth, by adding server-side authorization permission checks, to strip the config of all sensetive data when not fully authenticated.

This broke partly-authenticated users, as the browser was marking them as authenticated, but the token was expired, so the server refused to serve the full config 😵

This PR fixes that. When the token is expired or otherwise invalid, it will initiate the reauthentication flow. This should happen in the background without user noticing anything, unless they've configured their OIDC provider to require explicit re-entry of credentials.

I also added small frontend change, so that the app notices when it's not properly authenticated, and shows appropriate messaging plus a re-login button.

Issue Number

Fixes #2159

@netlify
Copy link
Copy Markdown

netlify Bot commented May 21, 2026

Deploy Preview for dashy-dev ready!

Name Link
🔨 Latest commit 0566ce9
🔍 Latest deploy log https://app.netlify.com/projects/dashy-dev/deploys/6a0f765d9c87fb0008097c97
😎 Deploy Preview https://deploy-preview-2160--dashy-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@lissy93 lissy93 mentioned this pull request May 21, 2026
5 tasks
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a regression introduced by tighter server-side OIDC enforcement (v4.1.8) where clients could appear “logged in” client-side while the server rejected expired/invalid tokens, resulting in a stripped/empty config experience.

Changes:

  • Add a server “bootstrap” marker to stripped /conf.yml responses and allow /conf.yml to fall back to bootstrap when Bearer verification fails (to trigger re-auth instead of hard-failing).
  • Require authentication for non-root *.yml files (e.g. /sub.yml) and expand server tests accordingly.
  • Update Home/Minimal views + English strings to detect bootstrap state and show “session expired” messaging with a re-login action.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
services/auth-oidc.js Adds _bootstrap marker and introduces a permissive option to let specific routes fall through on token verification failure.
services/app.js Uses permissive OIDC middleware for /*.yml so /conf.yml can bootstrap even with an invalid/expired Bearer, while sub-YAML files are gated.
src/utils/auth/OidcAuth.js Detects bootstrap config and forces re-auth by clearing tokens and redirecting to the IdP.
src/views/Home.vue Shows “session expired” UI (instead of “No Data Configured”) when bootstrap config is detected.
src/views/Minimal.vue Same bootstrap/session-expired UI handling for Minimal view.
src/assets/locales/en.json Adds English i18n strings for the session-expired messaging and button label.
tests/server/conf-strip.test.js Extends coverage for _bootstrap fields and the new auth behavior for sub-YAML + invalid Bearer handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/utils/auth/OidcAuth.js
Comment thread src/views/Home.vue Outdated
Comment thread src/views/Minimal.vue Outdated
@lissy93 lissy93 merged commit 103ac4e into master May 21, 2026
15 checks passed
@lissy93 lissy93 deleted the fix/refresh-oidc-token branch May 21, 2026 21:19
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.

[BUG] No Data Configured

2 participants