ThreadLocal<String> authenticatedUserIdThreadLocal sometimes null
I have implemented a small widget to allow the users to add comments to a task. I use AngularJS and I use activiti-reset and I pass the basic authentication hash as a http header. the problem that authenticatedUserIdThreadLocal.get() is inconsistent and it doesn't return always the authenticated and sometimes it returns null.
as you can see in the picture the user id is available and printed. but just in the middle there was no user id.
Any idea how to resolve such issue? I would really appreciate it.
Also the issue that sometimes if other user just logged in Authentication.getAuthenticatedUserId(); returns the other username instead of my username I am not sure how the threads are sharing the same value.