#Spring Security - User able to log in but SecurityContextHolder always returning null

1 messages · Page 1 of 1 (latest)

rugged surge
#

Hi guys. I'm working with a friend on a full stack project. He has a custom login page on the frontend so I tried implementing my login service so I don't have to use default .formlogin() from Spring Security.
Everything worked fine with default form but now that I try to use the custom login SecurityContextHolder always returns null. I'm able to call loginUser from UserService and it returns Logged in, and should set the SecurityContextHolder to the user logged in, but when i try to see what user is logged in in isUsserSessionActive method it always returns anonymousUser. I'm at my wits end here. Any ideas?
https://github.com/mich-wierzch/CatAdoption/tree/dev
Please see repo for source code

GitHub

Contribute to mich-wierzch/CatAdoption development by creating an account on GitHub.

balmy windBOT
#

This post has been reserved for your question.

Hey @rugged surge! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.