Open Y-Maxym opened 7 months ago
@OnDecember Could you please provide more details to this ticket? Links to the current code. Links to some examples of how it could be done.
@OnDecember Could you please provide more details to this ticket? Links to the current code. Links to some examples of how it could be done.
@oleksandr-jr Sure! Here we can get Principal from the spring context and pull details from it (currentUser method), but that's for future solutions when we have a working authentication set up and working https://github.com/OnDecember/Measurements-Sensor/blob/main/src/main/java/org/maxym/spring/sensor/service/UserService.java#L84
Currently, a client writes a user to the subreddit. You need to get the user via SecurityContextHolder and write it into the subreddit field when creating it.