I am creating a jwt based authentication. That is working as a charm. I have created the sign up and login methods in the @restcontroller via the post.
Now, i need to create the update user method. For updating the informations of the logged users itself.
Before JWT we used to take the id of the logged user from the session. How to do this with JWT?
@PostMapping("/user/profile")
public ResponseEntity<?> saveProfile(@Valid @RequestBody UserProfileDTO userProfile) {
/* Of course the userPofileForm does not contain a hidden field
with the ID of the user because it woud allow the user to mofify
it and update another user.
*/
return null;
}