Skip to content

Commit

Permalink
Cache user detail when loading token.
Browse files Browse the repository at this point in the history
Closes #49.
  • Loading branch information
mik3y committed May 28, 2014
1 parent da29c04 commit 702e23f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ private User fetchUserForToken(AuthenticationToken token) throws BackendExceptio
new CacheLoader<AuthenticationToken, User>() {
@Override
public User load(AuthenticationToken token) throws Exception {
return fetchUserForToken(token);
final User user = fetchUserForToken(token);
if (user != null) {
mUserDetailCache.put(user.getUsername(), user);
}
return user;
}
}
);
Expand Down

0 comments on commit 702e23f

Please sign in to comment.