From bd10f82afd68acdd8979aa7f25eceb5c14d65be9 Mon Sep 17 00:00:00 2001 From: Okke Harsta Date: Mon, 28 Oct 2024 09:17:13 +0100 Subject: [PATCH] Formatter --- server/src/main/java/access/api/InvitationController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/access/api/InvitationController.java b/server/src/main/java/access/api/InvitationController.java index 3efb74a3..72f1b41d 100644 --- a/server/src/main/java/access/api/InvitationController.java +++ b/server/src/main/java/access/api/InvitationController.java @@ -154,7 +154,9 @@ public ResponseEntity> all(@Parameter(hidden = true) User user) Authentication authentication, HttpServletRequest servletRequest, HttpServletResponse servletResponse) { - Invitation invitation = invitationRepository.findByHash(acceptInvitation.hash()).orElseThrow(() -> new NotFoundException("Invitation not found")); + Invitation invitation = invitationRepository.findByHash(acceptInvitation.hash()) + .orElseThrow(() -> new NotFoundException("Invitation not found")); + if (!invitation.getId().equals(acceptInvitation.invitationId())) { throw new NotFoundException("Invitation not found"); }