Open vahid-forghani opened 2 years ago
I also noticed one thing in your code which will be fixed after you apply this change.
you didn't set authorities
for your user, because the authorities
is empty and you were always returning this empty authorities
but after you apply this change I mentioned I will be fixed.
https://github.com/amezenin/encyclopedia-kn/blob/7e864bcb59032941b1b5756c027f829ee9387d52/src/main/java/com/knits/product/security/UserDetailsServiceImpl.java#L22
here you created this nice class which is responsible for getting the
userDetail
to spring security so you can modify your method like this:and then you don't need
SecurityUser.fromUser(user)
anymore.