Cannot disable users with disable(String reason) method
Dear community,
I'd like to block users from login with user.disable("reason") method in my Servlet under certain condition.
I could read/write user properties, but the disable part doesn't work and I could still login with this user.

(code snippet attached below)
Did I miss something important to make it work?
Thanks a lot!
UserManager userManager = ((JackrabbitSession) session).getUserManager();
Authorizable userAuth = userManager.getAuthorizable(userId);
User user = (User) userManager.getAuthorizable(userId);
if (userAuth != null) {
int totalCount = 1;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Value[] userPropertyValueArray = userAuth.getProperty("profile/loginAttemptCount");
if (userPropertyValueArray != null) {
int userFailureLoginCount = Integer.parseInt(userPropertyValueArray[0].toString());
if (userFailureLoginCount == 5) {
Date nowTime = new Date();
long time = 15 * 60 * 1000;
Date lockUntil = new Date(nowTime.getTime() + time);
userAuth.setProperty("profile/lockUntil",
session.getValueFactory().createValue(sdf.format(lockUntil)));
user.disable("Reach failure login limit");
return;
} else {
totalCount = userFailureLoginCount + 1;
userAuth.setProperty("profile/loginAttemptCount", session.getValueFactory().createValue(totalCount));
}
}
userAuth.setProperty("profile/loginAttemptTimestamp",
session.getValueFactory().createValue(sdf.format(new Date())));
}
session.save();
session.logout();