@Override
  public Credentials updateProfile(com.tasktop.c2c.server.profile.domain.project.Profile p)
      throws ValidationFailedException, NoSuchEntityException {
    try {
      profileWebService.updateProfile(p);
      String newPassword = p.getPassword();
      if (newPassword != null && newPassword.length() > 0) {
        return logon(p.getUsername(), newPassword, false);
      }
      return getCurrentUser();
    } catch (ValidationException e) {
      handle(e);
    } catch (EntityNotFoundException e) {
      handle(e);
    } catch (AuthenticationFailedException e) {
      // should never happen
      throw new IllegalStateException(e);
    }

    // should never happen
    throw new IllegalStateException();
  }