@Path("{userId}")
@PUT
public Response updateUser(@Context SecurityContext sc, @PathParam("userId") String userId, UpdateUserRequest request) {
ExternalUser userMakingRequest = (ExternalUser)sc.getUserPrincipal();
if(!userMakingRequest.getId().equals(userId)) {
throw new AuthorizationException("User not authorized to modify this profile");
}
boolean sendVerificationToken = StringUtils.hasLength(request.getEmailAddress()) &&
!request.getEmailAddress().equals(userMakingRequest.getEmailAddress());
ExternalUser savedUser = userService.saveUser(userId, request);
if(sendVerificationToken) {