Class EmailVerificationController

java.lang.Object
com.ericbouchut.learndev.auth.EmailVerificationController

@Controller public class EmailVerificationController extends Object
Web endpoints of the email verification flow: the emailed link lands on GET /auth/verify (public, like the whole /auth prefix), and a logged-in user can ask for a fresh link from the dashboard banner. The outcome is carried by query flags on the redirect targets, following the house PRG idiom.
  • Constructor Details

  • Method Details

    • verify

      @GetMapping("/auth/verify") public String verify(@RequestParam String token, jakarta.servlet.http.HttpServletRequest request)
      Consume the emailed verification link.
      Parameters:
      token - the raw token from the link
      request - provides the client IP for the audit trail
      Returns:
      a redirect to the login page with a verified or invalid flag
    • resend

      @PostMapping("/auth/verify/resend") public String resend(Principal principal, jakarta.servlet.http.HttpServletRequest request)
      Send a fresh verification link to the logged-in user (dashboard banner action).
      Parameters:
      principal - the logged-in user, or null when the session expired
      request - provides the client IP and the absolute verify URL
      Returns:
      a redirect to the dashboard with a confirmation flag