Merge branch 'reset-password' of https://github.com/gerbermichi/keycloak into gerbermichi-reset-password
This commit is contained in:
commit
39daeca09c
2 changed files with 9 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue