Skip to content

Commit

Permalink
change userModel and add doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreampie committed Dec 5, 2014
1 parent c5558ec commit f9d05e0
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,6 @@ public class MyJdbcRealm extends AuthorizingRealm {
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
UsernamePasswordToken userToken = (UsernamePasswordToken) token;
User user = null;
// if (userToken.getUsername().equalsIgnoreCase(MyAnonymousFilter.getUsername())) {
// PasswordService passwordService = new DefaultPasswordService();
// return new SimpleAuthenticationInfo(MyAnonymousFilter.getUsername(), passwordService.encryptPassword(MyAnonymousFilter.getPassword()), getName());
// } else {
String username = userToken.getUsername();
if (ValidateKit.isEmail(username)) {
user = User.dao.findFirstBy(" `user`.email =? AND `user`.deleted_at is null", username);
Expand All @@ -205,15 +201,11 @@ public class MyJdbcRealm extends AuthorizingRealm {
user = User.dao.findFirstBy(" `user`.username =? AND `user`.deleted_at is null", username);
}
if (user != null) {
// Session session = SecurityUtils.getSubject().getSession();
// session.setAttribute(AppConstants.TEMP_USER, user);
SimpleAuthenticationInfo info = new SimpleAuthenticationInfo(user, user.getStr("password"), getName());
// clearCachedAuthorizationInfo(info.getPrincipals());
return info;
} else {
return null;
}
// }
}

/**
Expand Down

0 comments on commit f9d05e0

Please sign in to comment.