KEYCLOAK-10817 Set referrer on error

This commit is contained in:
Kohei Tamura 2019-07-29 11:36:13 +09:00 committed by Pedro Igor
parent da85cff53b
commit c0f73c0df4

View file

@ -412,10 +412,12 @@ public class AccountFormService extends AbstractSecuredLocalService {
String clientId = formData.getFirst("clientId");
if (clientId == null) {
setReferrerOnPage();
return account.setError(Response.Status.BAD_REQUEST, Messages.CLIENT_NOT_FOUND).createResponse(AccountPages.APPLICATIONS);
}
ClientModel client = realm.getClientById(clientId);
if (client == null) {
setReferrerOnPage();
return account.setError(Response.Status.BAD_REQUEST, Messages.CLIENT_NOT_FOUND).createResponse(AccountPages.APPLICATIONS);
}
@ -845,6 +847,7 @@ public class AccountFormService extends AbstractSecuredLocalService {
}
if (userIds == null || userIds.length == 0) {
setReferrerOnPage();
return account.setError(Status.BAD_REQUEST, Messages.MISSING_PASSWORD).createResponse(AccountPages.PASSWORD);
}
@ -860,6 +863,7 @@ public class AccountFormService extends AbstractSecuredLocalService {
}
if (user == null) {
setReferrerOnPage();
return account.setError(Status.BAD_REQUEST, Messages.INVALID_USER).createResponse(AccountPages.RESOURCE_DETAIL);
}