Merge branch 'reset-password' of https://github.com/gerbermichi/keycloak into gerbermichi-reset-password

This commit is contained in:
Stian Thorgersen 2015-01-05 14:26:51 +01:00
commit 39daeca09c
2 changed files with 9 additions and 2 deletions

View file

@ -816,7 +816,10 @@ public class LoginActionsService {
if (user == null) {
event.error(Errors.USER_NOT_FOUND);
} else {
}
else if(!user.isEnabled()) {
event.error(Errors.USER_DISABLED);
}else{
UserSessionModel userSession = session.sessions().createUserSession(realm, user, username, clientConnection.getRemoteAddr(), "form", false);
event.session(userSession);
TokenManager.attachClientSession(userSession, clientSession);

View file

@ -686,7 +686,11 @@ public class UsersResource {
UserModel user = session.users().getUserByUsername(username, realm);
if (user == null) {
throw new NotFoundException("User not found");
return Flows.errors().error("User not found", Response.Status.NOT_FOUND);
}
if (!user.isEnabled()) {
return Flows.errors().error("User is disabled", Response.Status.BAD_REQUEST);
}
if (user.getEmail() == null) {