Skip to content

Don't crash when encountering mixed auth v1/v2 info.json - #4622

Merged
marlo-longley merged 1 commit into
mainfrom
auth2-services-without-profile
Oct 30, 2026
Merged

marlo-longley merged 1 commit into
mainfrom
auth2-services-without-profile

Conversation

@jcoyne

@jcoyne jcoyne commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

AuthProbeService2 has no profile, so the old code threw TypeError: Cannot read properties of undefined (reading 'match'). With the guard, the v2 service drops out of the filter and the v1 token lookup runs as before.

AuthProbeService2 has no profile, so the old code threw TypeError: Cannot read properties of undefined (reading 'match'). With the guard, the v2 service drops out of the filter and the v1 token lookup runs as before.
@codecov

codecov Bot commented Oct 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.9%. Comparing base (c82d038) to head (d053a8f).

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #4622   +/-   ##
=====================================
  Coverage   94.9%   94.9%           
=====================================
  Files        394     394           
  Lines       5850    5850           
  Branches    2002    2003    +1     
=====================================
  Hits        5550    5550           
  Misses       271     271           
  Partials      29      29           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@marlo-longley

marlo-longley commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

@jcoyne on this branch one part of the /auth demo page stops working
The "NHS Reorganization" content warning click-through is not showing up.
On main:
Screenshot 2026-10-28 at 9 53 13 AM

On your branch:

Screenshot 2026-10-28 at 9 52 13 AM

This is the manifest, which provides an Auth2 probe as well as an Auth0 cookie service.
https://iiif.wellcomecollection.org/image/b19319174_PP_RKF_B_20_2_5_0001.JP2/info.json

If you can confirm that you also are missing the Content Warning login bar on this branch, I think we should make sure that stays in.

@jcoyne

jcoyne commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator Author

So, the main branch behavior seems to depend on this crash occurring:

Screenshot 2026-10-28 at 11 07 53 AM

the saga then dies, and the degraded info response never gets saved

With nothing saved, selectCurrentAuthServices (src/state/selectors/auth.js:57-63) falls back to the image service embedded in the manifest. That one says "profile": "http://iiif.io/api/auth/0/clickthrough", which is in auth.serviceProfiles, so the content warning bar shows.

It looks like the Wellcome manifest is using auth v0. (see presentation/v2/b19319174). The manifest says auth/0/clickthrough, and the info.json says auth/0/login/clickthrough. Wellcome is inconsistent between the two, and the ogin/clickthrough form is the old Auth 0.9 spelling.

@jcoyne

jcoyne commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator Author

@marlo-longley it looks like that auth page is broken on main: #4623

@marlo-longley
marlo-longley merged commit 53e1bf9 into main Oct 30, 2026
9 checks passed
@marlo-longley
marlo-longley deleted the auth2-services-without-profile branch October 30, 2026 15:05
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