diff --git a/src/main/java/com/teamoff/api/controller/AuthController.java b/src/main/java/com/teamoff/api/controller/AuthController.java index f0c3681..64a5666 100644 --- a/src/main/java/com/teamoff/api/controller/AuthController.java +++ b/src/main/java/com/teamoff/api/controller/AuthController.java @@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.RestController; @RestController -@RequestMapping("/login") +@RequestMapping("/auth") public class AuthController { private final AuthenticationManager manager; @@ -26,7 +26,8 @@ public AuthController(AuthenticationManager manager, TokenService tokenService) this.tokenService = tokenService; } - @PostMapping + + @PostMapping("/login") public ResponseEntity login(@RequestBody @Valid AuthRequestDTO data){ Authentication authentication = manager.authenticate( new UsernamePasswordAuthenticationToken(data.login(), data.password()) @@ -34,4 +35,5 @@ public ResponseEntity login(@RequestBody @Valid AuthRequestDTO data){ var tokenJWT = tokenService.generateToken((Auth) authentication.getPrincipal()); return ResponseEntity.ok(new TokenResponseDTO(tokenJWT)); } + }