aley please do not create duplicate posts. Eventually somebody will give an answer to your existing post. I was pretty sure your other post contained the same question. As I said there the answer is basically the same.
There is no native way to enable oauth providers but not password login/register. If you're just looking at hiding them you can use CSS rules (but this won't stop them from working).
To block standard register or login you'd need to do that as part of an extension. Maybe blocking the /login
endpoint with a webserver rule might be enough to prevent normal login. This method doesn't apply to register endpoint because it's still used to do the final part of oauth registration.
Regarding extending the login modal that's certainly one way of doing it, though it will probably break if any other extension tries to extend the modal as well. You should use the extend
or override
helpers of Flarum where possible. You could use something similar to what I did in the Flagrow Terms extension to add stuff to that modal. I also explain how and why I had to do it that way in a video here if you're interested clarkwinkelmann
Let us know if you have problems implementing one of these specific solutions.