保誠-保戶業務員媒合平台
pamapi/src/main/java/com/pollex/pam/web/rest/OtpResource.java
@@ -3,6 +3,7 @@
import java.util.Arrays;
import java.util.UUID;
import com.pollex.pam.aop.logging.audit.AuditLoggingInject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -30,6 +31,8 @@
import com.pollex.pam.service.dto.OtpResponseDTO;
import com.pollex.pam.web.rest.vm.OtpLoginVM;
import com.pollex.pam.web.rest.vm.VerifyOtpVM;
import static com.pollex.pam.aop.logging.audit.AuditLoggingType.CUSTOMER_LOGIN;
@RestController
@RequestMapping("/api/otp")
@@ -81,6 +84,7 @@
        return new ResponseEntity<>(otpResponse, HttpStatus.OK);
    }
    @AuditLoggingInject(type = CUSTOMER_LOGIN)
    @PostMapping("/verify")
    public ResponseEntity<UserJWTController.JWTToken> verifyOtp(@RequestBody VerifyOtpVM verifyOtpParam) {
       otpUtilService.verifyOtp(verifyOtpParam);
@@ -90,7 +94,7 @@
                      .orElse(null);
       if (customer == null) {
          return ResponseEntity.status(HttpStatus.UNAUTHORIZED).build();
          return ResponseEntity.status(HttpStatus.FORBIDDEN).build();
       }
       String jwt = customerAuthService.authorize(customer, verifyOtpParam.getIndexKey(), verifyOtpParam.getOtpCode());