Skip to content

fix: support Verdaccio 6.5.0 ui-options external script#213

Merged
n4bb12 merged 1 commit into
n4bb12:mainfrom
Francesco-P-EM:fix/verdaccio-6.5-ui-options-compat
Apr 13, 2026
Merged

fix: support Verdaccio 6.5.0 ui-options external script#213
n4bb12 merged 1 commit into
n4bb12:mainfrom
Francesco-P-EM:fix/verdaccio-6.5-ui-options-compat

Conversation

@Francesco-P-EM

@Francesco-P-EM Francesco-P-EM commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Problem

Verdaccio 6.5.0 moved __VERDACCIO_BASENAME_UI_OPTIONS from an inline <script> tag in the HTML to an external ui-options.js file (verdaccio/verdaccio@df612faef, #5792).

The PatchHtml guard checks for __VERDACCIO_BASENAME_UI_OPTIONS in the response body to detect the Verdaccio web UI HTML before injecting the plugin's client script. Since the string is no longer in the HTML, the plugin script is never injected - causing the login button to show the default username/password modal instead of redirecting to GitHub OAuth.

Fix

Also check for ui-options.js in the response body, which is the new external script that Verdaccio 6.5.0 uses to load UI options. This keeps backward compatibility with Verdaccio <=6.4 (which still inlines the options).

Test plan

  • Added unit tests for PatchHtml.insertTags covering legacy HTML (<=6.4), modern HTML (>=6.5), and non-HTML responses
  • Verified manually by running Verdaccio 6.5.0 in Docker with the patched plugin - clicking Login correctly redirects to GitHub OAuth

Note: I relied heavily on Claude to investigate and fix this issue. If I missed anything fundamental or you have suggestions for a better approach, feedback is very welcome!

Verdaccio 6.5.0 (verdaccio/verdaccio@df612faef, #5792) moved
__VERDACCIO_BASENAME_UI_OPTIONS from an inline script in the HTML
to an external ui-options.js file. The PatchHtml guard checked for
that string in the response body, so the plugin script was never
injected - causing the login button to show the default
username/password modal instead of redirecting to GitHub OAuth.

Check for both the legacy inline marker and the new external script
filename so the plugin works with Verdaccio <=6.4 and >=6.5.

@n4bb12 n4bb12 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thank you!

@n4bb12 n4bb12 merged commit 76d0205 into n4bb12:main Apr 13, 2026
4 checks passed
@Francesco-P-EM Francesco-P-EM deleted the fix/verdaccio-6.5-ui-options-compat branch April 14, 2026 06:38
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.

2 participants