Skip to content

Commit

Permalink
Fix REST response code
Browse files Browse the repository at this point in the history
  • Loading branch information
fperot74 authored Aug 20, 2021
1 parent 03cf734 commit 60638af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public Response removeCredential(final @PathParam("credentialId") String credent
}

session.userCredentialManager().removeStoredCredential(realm, user, credentialId);
return Response.ok().build();
return Response.noContent().build();
}

/**
Expand All @@ -113,7 +113,7 @@ public Response setLabel(final @PathParam("credentialId") String credentialId, S
}

session.userCredentialManager().updateCredentialLabel(realm, user, credentialId, userLabel);
return Response.ok().build();
return Response.noContent().build();
}

/**
Expand Down Expand Up @@ -147,7 +147,7 @@ public Response moveCredentialAfter(final @PathParam("credentialId") String cred
}

session.userCredentialManager().moveCredentialTo(realm, user, credentialId, newPreviousCredentialId);
return Response.ok().build();
return Response.noContent().build();
}

@GET
Expand Down Expand Up @@ -199,7 +199,7 @@ public Response passwordUpdate(PasswordUpdate update) {
return ErrorResponse.error(e.getMessage(), e.getParameters(), Response.Status.BAD_REQUEST);
}

return Response.ok().build();
return Response.noContent().build();
}

public static class PasswordDetails {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public Response deleteAccount() {
.detail("ct_event_type", "SELF_DELETE_ACCOUNT")
.detail("username", delUser.getUsername())
.success();
return Cors.add(request, Response.ok()).auth().allowedOrigins(auth.getToken()).build();
return Cors.add(request, Response.noContent()).auth().allowedOrigins(auth.getToken()).build();
} else {
event.event(EventType.UPDATE_PROFILE).user(delUser)
.client(auth.getClient())
Expand Down Expand Up @@ -150,7 +150,7 @@ public Response executeActionsEmail(@QueryParam("lifespan") Integer lifespan, Li
.setUser(user)
.sendExecuteActions(link, TimeUnit.SECONDS.toMinutes(lifespan));

return Response.ok().build();
return Response.noContent().build();
} catch (EmailException e) {
ServicesLogger.LOGGER.failedToSendActionsEmail(e);
return ErrorResponse.error("Failed to send execute actions email", Status.INTERNAL_SERVER_ERROR);
Expand Down

0 comments on commit 60638af

Please sign in to comment.