|
18 | 18 | import lombok.RequiredArgsConstructor;
|
19 | 19 | import org.springframework.http.HttpHeaders;
|
20 | 20 | import org.springframework.http.HttpStatus;
|
| 21 | +import org.springframework.http.ResponseEntity; |
21 | 22 | import org.springframework.security.core.Authentication;
|
22 | 23 | import org.springframework.web.bind.annotation.*;
|
23 | 24 |
|
@@ -83,15 +84,18 @@ public AuthResponseDto refreshToken(HttpServletRequest request) {
|
83 | 84 | }
|
84 | 85 |
|
85 | 86 | @Operation(summary = "Activate account", responses = {
|
86 |
| - @ApiResponse(responseCode = "200", description = SUCCESSFULLY_ACTIVATED_ACCOUNT), |
87 |
| - @ApiResponse(responseCode = "404", description = EMAIL_TOKEN_NOT_FOUND, |
88 |
| - content = @Content(schema = @Schema(implementation = ApiErrorResponseDto.class))) |
89 |
| - }) |
90 |
| - @PostMapping(path = ACTIVATE, consumes = APPLICATION_JSON_VALUE) |
91 |
| - public void activateAccount() { |
92 |
| - authService.activateAccount(); |
| 87 | + @ApiResponse(responseCode = "200", description = SUCCESSFULLY_ACTIVATED_ACCOUNT), |
| 88 | + @ApiResponse(responseCode = "404", description = EMAIL_TOKEN_NOT_FOUND, |
| 89 | + content = @Content(schema = @Schema(implementation = ApiErrorResponseDto.class))), |
| 90 | + @ApiResponse(responseCode = "400", description = "Invalid or expired token") |
| 91 | + }) |
| 92 | + @PostMapping(path = ACTIVATE) |
| 93 | + public ResponseEntity<String> activateAccount(@RequestParam("token") String token) { |
| 94 | + authService.activateAccount(token); // Передаем токен для активации |
| 95 | + return ResponseEntity.ok("Account successfully activated"); |
93 | 96 | }
|
94 | 97 |
|
| 98 | + |
95 | 99 | @Operation(summary = "Resend email", responses = {
|
96 | 100 | @ApiResponse(responseCode = "200", description = SUCCESSFULLY_ACTIVATED_ACCOUNT)
|
97 | 101 | })
|
|
0 commit comments