Class AuthenticationController

java.lang.Object
com.mirna.hospitalmanagementapi.application.controllers.auth.AuthenticationController

@RestController @RequestMapping("/api/auth") public class AuthenticationController extends Object
A Spring REST controller for managing authentication and user information.
Version:
1.0
Author:
Mirna Gama
  • Constructor Details

    • AuthenticationController

      public AuthenticationController()
  • Method Details

    • login

      @PostMapping("/login") public org.springframework.http.ResponseEntity<Object> login(@RequestBody @Valid @Valid UserDTO userDTO)
      Performs the user login
      Parameters:
      userDTO - A data transfer object containing the user data to perform the login
      Returns:
      The authorization token if successful, or an unauthorized status if there is an error.
    • register

      @PostMapping("/register") public org.springframework.http.ResponseEntity<Object> register(@RequestBody @Valid @Valid UserDTO userDTO)
      Performs the user registration
      Parameters:
      userDTO - A data transfer object containing the user data to perform the registration
      Returns:
      The registered user if successful, or null if there is an error.