Class VerificationCodeController

java.lang.Object
com.bank.auth_service.controller.VerificationCodeController

@RestController @RequestMapping("/code") public class VerificationCodeController extends Object
Controller for handling verification code operations. Provides endpoints for generating and validating verification codes.
Since:
1.0.0
Version:
1.0.0, 06/23/2025
Author:
Fernando Cruz Cavina
See Also:
  • Constructor Details

  • Method Details

    • generate

      @PostMapping("/generate") public org.springframework.http.ResponseEntity<String> generate(@RequestBody String key)
      Generates a 6-digit verification code for the provided key. The code is sent to the user's email.
      Parameters:
      key - the unique key for which the verification code is generated
      Returns:
      a message that says that the code was created and that it's in the email
    • validateCode

      @PostMapping("/validate") public org.springframework.http.ResponseEntity<String> validateCode(@RequestBody ConfirmCodeDto confirmCode)
      Validates the given verification code against the provided key.
      Parameters:
      confirmCode - the DTO containing the code and its associated key
      Returns:
      a confirmation message if the code is valid