Skip to content

Commit b552d20

Browse files
committed
Treat tokens for deleted groups as invalid
Previously this exception was unhandled, and so the user saw an error that did not make it clear there was no point trying again.
1 parent f952559 commit b552d20

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/main/java/uk/ac/cam/cl/dtg/segue/api/AuthorisationFacade.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -474,9 +474,8 @@ public Response getTokenOwnerUserSummary(@Context final HttpServletRequest reque
474474
.cacheControl(getCacheControl(Constants.NEVER_CACHE_WITHOUT_ETAG_CHECK, false)).build();
475475
} catch (NoUserLoggedInException e) {
476476
return SegueErrorResponse.getNotLoggedInResponse();
477-
} catch (InvalidUserAssociationTokenException e) {
478-
log.info(String.format("User (%s) attempted to use token (%s) but it is invalid or no longer exists.",
479-
currentRegisteredUser.getId(), token));
477+
} catch (InvalidUserAssociationTokenException | ResourceNotFoundException e) {
478+
log.info("User ({}) attempted to use token ({}) but it is invalid or no longer exists.", currentRegisteredUser.getId(), token);
480479

481480
return new SegueErrorResponse(Status.BAD_REQUEST, "The token provided is invalid or no longer exists.")
482481
.toResponse();

0 commit comments

Comments
 (0)