Class UserInfoController

java.lang.Object
edu.ucsb.cs156.example.controllers.ApiController
edu.ucsb.cs156.example.controllers.UserInfoController

@RequestMapping("/api/currentUser") @RestController public class UserInfoController extends ApiController
This is a REST controller for getting information about the current user.
  • Constructor Details Link icon

    • UserInfoController Link icon

      public UserInfoController()
  • Method Details Link icon

    • getCurrentUser Link icon

      @PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("") public CurrentUser getCurrentUser()
      This method returns the current user.
      Overrides:
      getCurrentUser in class ApiController
      Returns:
      the current user