0

I am trying to use spring lemon for user handling. I am sending a registration request which gets a 201 response and sends an email to the user, but when the user clicks the link he gets a "Request method 'GET' not supported" response. I looked at the spring lemon code, and in LemonController.java line 104 the verifyUser method uses a @PostMapping annotation. Shouldn't it use a GET annotation? The link from the email creates a GET request, not POST.

Thanks.

barisdad
  • 515
  • 7
  • 19
  • It's clear that you're trying to make a GET request on a POST method. You simply cannot do that. You have to be more specific and provide some code so we can check it out. – neocorp May 21 '17 at 09:21
  • I can't provide an isolated example. Just consider this - the user gets a verify link via email. As far as I know clicking this link always generates a GET request, not POST. – barisdad May 21 '17 at 09:58
  • Well in that case either your mapping is wrong or generated url for clicking is incorrect. – neocorp May 21 '17 at 10:35
  • I didn't generate the mapping. I am using a library called spring lemon and this is where I think the wrong url mapping is. This is the method I spoke about (line 104) https://github.com/naturalprogrammer/spring-lemon/blob/master/src/main/java/com/naturalprogrammer/spring/lemon/LemonController.java and this is the method which sends the email to the user (line 246) https://github.com/naturalprogrammer/spring-lemon/blob/master/src/main/java/com/naturalprogrammer/spring/lemon/LemonService.java Seems to me pretty clear that it sends a url for GET and expects a POST. – barisdad May 21 '17 at 11:24
  • OK, I understand my mistake. I am supposed to implement the verification page myself and send a POST request to the API url. – barisdad May 21 '17 at 11:58
  • Yeah that is what you need. – neocorp May 21 '17 at 12:06
  • Correct - see https://github.com/naturalprogrammer/lemon-demo-angular1 for an example front-end – Sanjay May 21 '17 at 15:18

0 Answers0