Skip to content

Commit

Permalink
Added the short log for DisabledException (#7028)
Browse files Browse the repository at this point in the history
  • Loading branch information
Camelia-Orcid authored Apr 28, 2024
1 parent 0eb93f9 commit 81a3446
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.MessageSource;
import org.springframework.security.authentication.DisabledException;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;
import org.springframework.security.oauth2.common.exceptions.RedirectMismatchException;
Expand Down Expand Up @@ -116,6 +117,8 @@ public Response toResponse(Throwable t) {
logShortError(t, clientId);
} else if (t instanceof DeactivatedException) {
logShortError(t, clientId);
} else if (t instanceof DisabledException) {
logShortError(t, clientId);
} else if (t instanceof ClientDeactivatedException) {
logShortError(t, clientId);
} else if (t instanceof OrcidNonPublicElementException) {
Expand Down Expand Up @@ -249,7 +252,11 @@ private Response legacyErrorResponse(Throwable t) {
} else if (LockedException.class.isAssignableFrom(t.getClass())) {
OrcidMessage entity = getLegacyOrcidEntity("Account locked : ", t);
return Response.status(Response.Status.CONFLICT).entity(entity).build();
} else if (ClientDeactivatedException.class.isAssignableFrom(t.getClass())) {
}else if (DisabledException.class.isAssignableFrom(t.getClass())) {
OrcidMessage entity = getLegacyOrcidEntity("Account not active: ", t);
return Response.status(Response.Status.CONFLICT).entity(entity).build();
}
else if (ClientDeactivatedException.class.isAssignableFrom(t.getClass())) {
OrcidMessage entity = getLegacyOrcidEntity("Client deactivated : ", t);
return Response.status(Response.Status.CONFLICT).entity(entity).build();
} else if (NoResultException.class.isAssignableFrom(t.getClass())) {
Expand Down

0 comments on commit 81a3446

Please sign in to comment.