Skip to content

Commit

Permalink
Added the short log for DisabledException
Browse files Browse the repository at this point in the history
  • Loading branch information
Camelia-Orcid committed Apr 25, 2024
1 parent b1e8a6c commit cddb684
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 cddb684

Please sign in to comment.