diff --git a/src/state/reducers/accessTokens.js b/src/state/reducers/accessTokens.js index 18199d404c4eda2d24ffcff2a95564e598a4ba73..76cbeba1c395627592c24042f79abb1d91e7ec73 100644 --- a/src/state/reducers/accessTokens.js +++ b/src/state/reducers/accessTokens.js @@ -10,7 +10,7 @@ export function accessTokensReducer(state = {}, action) { switch (action.type) { case ActionTypes.RECEIVE_INFO_RESPONSE: - if (action.ok && normalizeUrl(action.infoId, { stripAuthentication: false }) === normalizeUrl(action.infoJson['@id'], { stripAuthentication: false })) return state; + if (action.ok && normalizeUrl(action.infoId, { stripAuthentication: false }) === normalizeUrl(action.infoJson.id || action.infoJson['@id'], { stripAuthentication: false })) return state; authService = Utils.getService({ ...action.infoJson, options: {} }, 'http://iiif.io/api/auth/1/external'); if (!authService) return state; diff --git a/src/state/reducers/auth.js b/src/state/reducers/auth.js index dba35572f71960a7151ed433d4b70e32740332c7..99594e001aaa12982990684bcba1039ef355cb79 100644 --- a/src/state/reducers/auth.js +++ b/src/state/reducers/auth.js @@ -10,7 +10,7 @@ export const authReducer = (state = {}, action) => { switch (action.type) { case ActionTypes.RECEIVE_INFO_RESPONSE: - if (action.ok && normalizeUrl(action.infoId, { stripAuthentication: false }) === normalizeUrl(action.infoJson['@id'], { stripAuthentication: false })) return state; + if (action.ok && normalizeUrl(action.infoId, { stripAuthentication: false }) === normalizeUrl(action.infoJson.id || action.infoJson['@id'], { stripAuthentication: false })) return state; service = selectNextAuthService( { auth: state }, action.infoJson, { external: true, kiosk: true }, diff --git a/src/state/reducers/infoResponses.js b/src/state/reducers/infoResponses.js index 3877d96336851fc13cf7eaf876db4feb66b3b5e1..558a2dd12936e3fbd3502df8a237a071def3f12b 100644 --- a/src/state/reducers/infoResponses.js +++ b/src/state/reducers/infoResponses.js @@ -18,7 +18,7 @@ export const infoResponsesReducer = (state = {}, action) => { return { ...state, [action.infoId]: { - degraded: !action.ok || !(normalizeUrl(action.infoId, { stripAuthentication: false }) === normalizeUrl(action.infoJson['@id'], { stripAuthentication: false })), + degraded: !action.ok || !(normalizeUrl(action.infoId, { stripAuthentication: false }) === normalizeUrl(action.infoJson.id || action.infoJson['@id'], { stripAuthentication: false })), id: action.infoId, isFetching: false, json: action.infoJson,