Skip to content

Commit

Permalink
test cert > POST
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemaignent committed Jan 15, 2021
1 parent 1cdd8f2 commit 1635cab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.time.DayOfWeek;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;

@CrossOrigin(origins = "*")
Expand Down Expand Up @@ -109,7 +106,7 @@ public String deleteSign(@ModelAttribute("authUserEppn") String authUserEppn, @P
return "redirect:/user/users";
}

@GetMapping(value = "/view-cert")
@PostMapping(value = "/view-cert")
public String viewCert(@ModelAttribute("authUserEppn") String authUserEppn, @RequestParam(value = "password", required = false) String password, RedirectAttributes redirectAttributes) {
try {
redirectAttributes.addFlashAttribute("message", new JsonMessage("custom", userKeystoreService.checkKeystore(authUserEppn, password)));
Expand Down Expand Up @@ -288,4 +285,10 @@ private ResponseEntity<Void> getDocumentResponseEntity(HttpServletResponse respo
return new ResponseEntity<>(HttpStatus.OK);
}

@ResponseBody
@PostMapping(value ="/check-user-certificate")
private List<User> checkUserCertificate(@RequestBody List<String> userEmails) {
return userService.getUserWithoutCertificate(userEmails);
}

}
2 changes: 1 addition & 1 deletion src/main/resources/templates/user/users/update.html
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ <h5 class="text-center"><b>Fréquence des alertes</b></h5>
<div class="modal fade" id="testKeystore" tabindex="-1" role="dialog" aria-labelledby="testKeystore" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<form action="/user/users/view-cert" method="get">
<form th:action="'/user/users/view-cert'" method="post">
<div class="modal-header">
<h3 class="modal-title">Tester mon certificat</h3>
</div>
Expand Down

0 comments on commit 1635cab

Please sign in to comment.