adding email otp verification

This commit is contained in:
2025-10-09 20:33:12 +02:00
parent 230f16e08d
commit f6e04f302c
6 changed files with 54 additions and 27 deletions

View File

@@ -1,17 +1,24 @@
package zw.qantra.tm.domain.controllers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import zw.qantra.tm.domain.services.EmailService;
@RestController
@RequestMapping("/test")
@CrossOrigin(origins = "*")
public class TestController {
@Autowired
private EmailService emailService;
@GetMapping("/hello/{email}")
public ResponseEntity<String> helloEndpoint(@PathVariable String email) {
emailService.sendSimpleMessage(email, "Hello", "Hello World!");
return ResponseEntity.ok("Hello World!");
}
@GetMapping("/protected")
public ResponseEntity<String> protectedEndpoint() {