newaustriancodingschool / hackboard

Hackathon-Dashboard
6 stars 8 forks source link

UserService to getCurrentUser #76

Open rainerhahnekamp opened 6 years ago

rainerhahnekamp commented 6 years ago

Instead of using static methods of SecurityUtils and UserRepository to get the current logged in user, create a Spring Bean service, that can be injected into a controller and returns the user if logged in.

The signature should be like this.

public Optional<User> getCurrentUser();