Users deleting their own accounts in NextJS

I ended up crafting a custom controller like this:

plugin.controllers.user.destroyme = async (ctx) => {
    const authUser = ctx.state.user;

    if (!authUser) {
      return ctx.unauthorized();
    }

    const user = await getService('user').fetch(authUser.id);

    if (!user) {
      throw new NotFoundError(`User not found`);
    }

    const data = await getService('user').remove({ id: authUser.id });
    const sanitizedUser = await sanitizeOutput(data, ctx);

    ctx.send(sanitizedUser);
  };