JR-Abstract / reddit-clone-abstract

MIT License
1 stars 0 forks source link

In the subreddit, make set user using the security context #72

Open Y-Maxym opened 7 months ago

Y-Maxym commented 7 months ago

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.

oleksandr-jr commented 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.

Y-Maxym commented 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.

@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