Last change
on this file was 74af394, checked in by makyjovanovsky <mjovanovski04@…>, 20 months ago |
login/register with mail confirmation
|
-
Property mode
set to
100644
|
File size:
846 bytes
|
Line | |
---|
1 | package com.example.salonbella.controller.token;
|
---|
2 |
|
---|
3 | import com.example.salonbella.service.mail.ConfirmationTokenService;
|
---|
4 | import org.springframework.beans.factory.annotation.Autowired;
|
---|
5 | import org.springframework.stereotype.Controller;
|
---|
6 | import org.springframework.web.bind.annotation.GetMapping;
|
---|
7 | import org.springframework.web.bind.annotation.RequestParam;
|
---|
8 |
|
---|
9 | @Controller
|
---|
10 | public 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.