Skip to content

Commit

Permalink
fallback to v1 for external service
Browse files Browse the repository at this point in the history
  • Loading branch information
gestchild committed Oct 9, 2024
1 parent 9eec3e1 commit a053cba
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions content/webapp/utils/iiif/v3/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,13 @@ export function getAuthServices({
if (auth && authV2) {
return {
active: auth.v2.activeAccessService,
external: auth.v2.externalAccessService, // Only the v2 external service works (v1 responds with a 404), so we only try returning the v2 service
external: auth.v2.externalAccessService,
};
} else if (auth) {
return {
active: auth.v1.activeAccessService,
external: auth.v2.externalAccessService, // Only the v2 external service works (v1 responds with a 404), so we try returning the v2 service regardless of the toggle value, so we can use it if it is available
// Only the v2 external service works (v1 responds with a 404), we therefore try returning the v2 service, so we can use it if it is available. We still need to fallback to the v1 service as the presence of the service helps us determine whether to show the viewer or not.
external: auth.v2.externalAccessService || auth.v1.externalAccessService,
};
}
}
Expand All @@ -377,6 +378,7 @@ export function checkModalRequired(params: checkModalParams): boolean {
if (authServices?.active) {
return true;
} else if (authServices?.external) {
// TODO if we've got a v1 service then display a message to say the manifest needs regenerating
if (isAnyImageOpen || role === 'StaffWithRestricted') {
return false;
} else {
Expand Down Expand Up @@ -510,8 +512,7 @@ export function groupRanges(
);

if (
getDisplayLabel(acc.previousLabel) ===
getDisplayLabel(range.label) &&
getDisplayLabel(acc.previousLabel) === getDisplayLabel(range.label) &&
acc.previousLastCanvasIndex &&
firstCanvasIndex === acc.previousLastCanvasIndex + 1
) {
Expand Down

0 comments on commit a053cba

Please sign in to comment.