From e0e2ac0e2cbe5ba3fc3478b01ffe9620e2304767 Mon Sep 17 00:00:00 2001 From: Jack Reed <phillipjreed@gmail.com> Date: Fri, 4 Dec 2020 16:11:59 -0700 Subject: [PATCH] Fixes an infinite loop issue when third-part sites are requesting auth resources --- __tests__/src/sagas/auth.test.js | 18 ------------------ src/state/sagas/auth.js | 8 -------- 2 files changed, 26 deletions(-) diff --git a/__tests__/src/sagas/auth.test.js b/__tests__/src/sagas/auth.test.js index 229e9956e..66182bf5f 100644 --- a/__tests__/src/sagas/auth.test.js +++ b/__tests__/src/sagas/auth.test.js @@ -369,23 +369,5 @@ describe('IIIF Authentication sagas', () => { }) .run(); }); - - it('marks the auth service as failed if the auth token was not successfully used', () => { - const authId = 'authId'; - const serviceId = 'serviceId'; - - return expectSaga(invalidateInvalidAuth, { serviceId }) - .provide([ - [select(getAccessTokens), { [serviceId]: { authId, id: serviceId } }], - [select(getAuth), { [authId]: { id: authId } }], - ]) - .put({ - id: authId, - ok: false, - tokenServiceId: serviceId, - type: ActionTypes.RESOLVE_AUTHENTICATION_REQUEST, - }) - .run(); - }); }); }); diff --git a/src/state/sagas/auth.js b/src/state/sagas/auth.js index 0ecb94976..a17000a09 100644 --- a/src/state/sagas/auth.js +++ b/src/state/sagas/auth.js @@ -139,14 +139,6 @@ export function* invalidateInvalidAuth({ serviceId }) { authServiceId: authService.id, tokenServiceId: accessTokenService.id, })); - } else { - // if the token never worked, mark the auth service as bad so we could - // try to pick a different service - yield put(resolveAuthenticationRequest( - authService.id, - accessTokenService.id, - { ok: false }, - )); } } -- GitLab