diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2020-12-17 18:15:32 +0100 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2020-12-17 18:16:46 +0100 |
commit | 46749035a770a3542db8d1a6bb1258ea591e7078 (patch) | |
tree | d9009725981de1cf8dbadb5fbe3120de0e21504e /src | |
parent | 4db085417b5221c9fdd74f0c1ff704e1a827b193 (diff) |
Act as if everything was fine if an invalid registration key is used.
Change-Id: I78066954fef2e6afd9e49d56bd4c4060ad59796c
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/eu/mulk/mulkcms2/benki/newsletter/NewsletterResource.java | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/main/java/eu/mulk/mulkcms2/benki/newsletter/NewsletterResource.java b/src/main/java/eu/mulk/mulkcms2/benki/newsletter/NewsletterResource.java index 85af008..3786c9c 100644 --- a/src/main/java/eu/mulk/mulkcms2/benki/newsletter/NewsletterResource.java +++ b/src/main/java/eu/mulk/mulkcms2/benki/newsletter/NewsletterResource.java @@ -8,14 +8,12 @@ import io.quarkus.qute.api.CheckedTemplate; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; import javax.transaction.Transactional; -import javax.ws.rs.ClientErrorException; import javax.ws.rs.FormParam; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; -import javax.ws.rs.core.Response.Status; @Path("/newsletter") @Produces(TEXT_HTML) @@ -66,11 +64,7 @@ public class NewsletterResource { public TemplateInstance finishRegistration(@QueryParam("key") String registrationKey) { NewsletterSubscription.<NewsletterSubscription>find("registrationKey = ?1", registrationKey) .singleResultOptional() - .ifPresentOrElse( - s -> s.registrationKey = null, - () -> { - throw new ClientErrorException(Status.BAD_REQUEST); - }); + .ifPresent(s -> s.registrationKey = null); return Templates.registered(); } |