Class AuthController

java.lang.Object
tech.lastbox.lastshield.basicauth.controller.AuthController

@RestController @ConditionalOnProperty(name="lastshield.basicauth", havingValue="true") public class AuthController extends Object
Controller responsible for authentication and user management, including login and registration. This controller exposes endpoints to authenticate users and register new users, generating JWT tokens for valid users.
  • Constructor Details

  • Method Details

    • login

      @PostMapping("/login") public org.springframework.http.ResponseEntity<?> login(@RequestBody LoginRequest loginRequest)
      Endpoint for user login. Validates credentials and returns a JWT token.
      Parameters:
      loginRequest - the login credentials containing the username and password
      Returns:
      ResponseEntity with the login result and JWT token
    • register

      @PostMapping("/register") public org.springframework.http.ResponseEntity<?> register(@RequestBody RegisterRequest registerRequest)
      Endpoint for user registration. Registers a new user and returns a JWT token for authentication.
      Parameters:
      registerRequest - the user registration details
      Returns:
      ResponseEntity with the registration result and JWT token