Password safety in Userclass / Create User Profile

Get endpoint for users also retrieve passwords. Implement safety feature here. Maybe with @JsonIgnore annotation or UserProfile class which extends User class?