| | |
| | | |
| | | import com.moral.security.auth.JwtAuthenticationToken; |
| | | import com.moral.security.model.UserContext; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * End-point for retrieving logged-in user details. |
| | |
| | | @RestController |
| | | public class ProfileEndpoint { |
| | | @RequestMapping(value="/user-context", method=RequestMethod.GET) |
| | | @CrossOrigin(origins = "*", maxAge = 3600) |
| | | public @ResponseBody |
| | | UserContext get(JwtAuthenticationToken token) { |
| | | return token.getPrincipal(); |