Hi! I'm working on an Auth0 authentication extension. I prefer to route all login and registration through Auth0, which means I don't want the user to perform a manual registration when they first come to the forum. I've worked off the Flarum GitHub extension, and it works well with Oauth. Problem is, the way I understand the current registration code, if.a user doesn't already exist, the response is sent back and the person has to enter a password and proceed. I instead want to shortcut this and just create a user directly in the backend, in my extension controller.
In my controller, I am able to check if the user doesn't exist before, and create it using User::register(). This leads to the Auth/ResponseFactory.php to automatically logging in the new user. But when I want to add Avatar using AvatarUploader, similar to what happens when a normal user registration happens, I can't wrap my head around how to actually get hold of the right instances to make this possible. How do I find or instantiate AvatarUploader to load an avatar to the user?