Class UserController

java.lang.Object
vaultWeb.controllers.UserController

@RestController @RequestMapping("/api/auth") public class UserController extends Object
  • Constructor Details

    • UserController

      public UserController()
  • Method Details

    • register

      @PostMapping("/register") public org.springframework.http.ResponseEntity<String> register(@Valid @RequestBody @Valid UserDto user)
    • login

      @PostMapping("/login") public org.springframework.http.ResponseEntity<?> login(@Valid @RequestBody @Valid LoginRequest loginRequest, jakarta.servlet.http.HttpServletResponse response)
    • refresh

      @PostMapping("/refresh") public org.springframework.http.ResponseEntity<?> refresh(@CookieValue(name="refresh_token",required=false) String refreshToken, jakarta.servlet.http.HttpServletResponse response)
    • logout

      @PostMapping("/logout") public org.springframework.http.ResponseEntity<Void> logout(@CookieValue(name="refresh_token",required=false) String refreshToken, jakarta.servlet.http.HttpServletResponse response)
    • checkUsernameExists

      @GetMapping("/check-username") public org.springframework.http.ResponseEntity<Map<String,Boolean>> checkUsernameExists(@RequestParam String username)
    • getAllUsers

      @GetMapping("/users") public org.springframework.http.ResponseEntity<List<UserResponseDto>> getAllUsers()
    • changePassword

      @PostMapping("/change-password") public org.springframework.http.ResponseEntity<Void> changePassword(@Valid @RequestBody @Valid ChangePasswordRequest request)
    • getSecurityActivity

      @GetMapping("/security-activity") public org.springframework.http.ResponseEntity<List<SecurityEventDto>> getSecurityActivity()
    • logSecurityEvent

      @PostMapping("/security-activity/log") public org.springframework.http.ResponseEntity<Void> logSecurityEvent(@RequestBody Map<String,String> payload, jakarta.servlet.http.HttpServletRequest request)
    • uploadProfilePicture

      @PostMapping(value="/profile-picture", consumes="multipart/form-data") public org.springframework.http.ResponseEntity<Map<String,String>> uploadProfilePicture(@RequestParam("file") org.springframework.web.multipart.MultipartFile file) throws IOException
      Upload (or replace) the current user's profile picture.
      Throws:
      IOException
    • getProfilePicture

      @GetMapping("/profile-picture") public org.springframework.http.ResponseEntity<Map<String,String>> getProfilePicture()
      Get the current user's profile picture path.
    • deleteProfilePicture

      @DeleteMapping("/profile-picture") public org.springframework.http.ResponseEntity<Void> deleteProfilePicture()
      Delete the current user's profile picture.