I have User entity which implements UserDetails interface and UserService which implements UserDetailsService. I want to add a few information to Principal object when user request for it:
@GetMapping(value = "/getCurrentUserInfo")
public Principal currentUser(Principal principal) {
return principal;
}
I have to add something like first name, second name, userGroupId etc. How I can do it in Spring?
Should I @Override findByUsername() and then in UserRepository do the query like "SELECT * FROM USER"?