Skip to content

Commit

Permalink
Formatted the subscription is verified string to be valid html
Browse files Browse the repository at this point in the history
  • Loading branch information
Joergen committed Jun 21, 2024
1 parent 41c385a commit 73d199c
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import org.springframework.hateoas.CollectionModel;
import org.springframework.hateoas.server.mvc.WebMvcLinkBuilder;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.web.bind.WebDataBinder;
Expand Down Expand Up @@ -535,14 +536,21 @@ public ResponseEntity<String> removeTracking(@PathVariable Long classificationId
return ResponseEntity.ok("Subscription is deleted.");
}

@RequestMapping(value = "/classifications/verifyTracking/{email}/{token}", method = RequestMethod.GET)
@RequestMapping(value = "/classifications/verifyTracking/{email}/{token}", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
public ResponseEntity<String> verifyTracking(@PathVariable String email, @PathVariable String token) {
try {
subscriberService.verifyTracking(email, token);
} catch (ClientException e) {
throw new RestClientException(e.getMessage());
}
return ResponseEntity.ok("Subscription is verified.");
return ResponseEntity.ok("""
<html>
<header><title>Klass subscription</title></header>
<body>
Subscription is verified.
</body>
</html>
""");
}

private void addSearchLink(PagedModel<ClassificationSummaryResource> response) {
Expand Down

0 comments on commit 73d199c

Please sign in to comment.