| 1 | package edu.ucsb.cs156.frontiers.controllers; | |
| 2 | ||
| 3 | import edu.ucsb.cs156.frontiers.models.CurrentUser; | |
| 4 | import io.swagger.v3.oas.annotations.Operation; | |
| 5 | import io.swagger.v3.oas.annotations.tags.Tag; | |
| 6 | import org.springframework.security.access.prepost.PreAuthorize; | |
| 7 | import org.springframework.web.bind.annotation.GetMapping; | |
| 8 | import org.springframework.web.bind.annotation.RequestMapping; | |
| 9 | import org.springframework.web.bind.annotation.RestController; | |
| 10 | ||
| 11 | /** This is a REST controller for getting information about the current user. */ | |
| 12 | @Tag(name = "Current User Information") | |
| 13 | @RequestMapping("/api/currentUser") | |
| 14 | @RestController | |
| 15 | public class UserInfoController extends ApiController { | |
| 16 | ||
| 17 | /** | |
| 18 | * This method returns the current user. | |
| 19 | * | |
| 20 | * @return the current user | |
| 21 | */ | |
| 22 | @Operation(summary = "Get information about current user") | |
| 23 | @PreAuthorize("hasRole('ROLE_USER')") | |
| 24 | @GetMapping("") | |
| 25 | public CurrentUser getCurrentUser() { | |
| 26 |
1
1. getCurrentUser : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/UserInfoController::getCurrentUser → KILLED |
return super.getCurrentUser(); |
| 27 | } | |
| 28 | } | |
Mutations | ||
| 26 |
1.1 |