source: src/main/java/com/example/salonbella/controller/token/TokenController.java@ 4d7e387

Last change on this file since 4d7e387 was 4d7e387, checked in by makyjovanovsky <mjovanovski04@…>, 18 months ago

commit 1

  • Property mode set to 100644
File size: 846 bytes
Line 
1package com.example.salonbella.controller.token;
2
3import com.example.salonbella.service.mail.ConfirmationTokenService;
4import org.springframework.beans.factory.annotation.Autowired;
5import org.springframework.stereotype.Controller;
6import org.springframework.web.bind.annotation.GetMapping;
7import org.springframework.web.bind.annotation.RequestParam;
8
9@Controller
10public class TokenController {
11
12 private final ConfirmationTokenService confirmationTokenService;
13
14 @Autowired
15 public TokenController(ConfirmationTokenService confirmationTokenService) {
16 this.confirmationTokenService = confirmationTokenService;
17 }
18
19 @GetMapping("/confirm")
20 public String confirmToken(@RequestParam("token") String token) throws Exception {
21 confirmationTokenService.confirmToken(token);
22 return "redirect:/login";
23 }
24}
Note: See TracBrowser for help on using the repository browser.