Optional username and password

I’m creating a project where I need the user’s username and password to be optional and blank=True and null=True, and the user can only log in via email and the verification code that is sent to them, and then if they want, they can set their own username and password and use the password they set as two-step verification for login. I tried using AbstractUser and AbstractBaseUser but they have a mandatory password field by default. Is there any way to do this?

I would recommend setting username and password to randomly generated noise and just let it be.