Skip to content

Commit

Permalink
Update RegisterController.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Nonononoki committed Jan 9, 2024
1 parent cb0c948 commit 203a029
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/main/java/com/nonononoki/alovoa/rest/RegisterController.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@
import javax.crypto.NoSuchPaddingException;
import jakarta.mail.MessagingException;

import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;

import com.nonononoki.alovoa.model.AlovoaException;
import com.nonononoki.alovoa.model.RegisterDto;
Expand All @@ -40,4 +38,14 @@ public String registerOauth(@RequestBody RegisterDto dto) throws MessagingExcept
registerService.registerOauth(dto);
return "profile";
}

@GetMapping("/register/confirm/{tokenString}")
public void registerConfirm(@PathVariable String tokenString, HttpServletResponse response) throws IOException {
try {
registerService.registerConfirm(tokenString);
response.sendRedirect("/?registration-confirm-success");
} catch (Exception e) {
response.sendRedirect("/?registration-confirm-failed");
}
}
}

0 comments on commit 203a029

Please sign in to comment.