Disabling email registration breaks changing your password.
Changing your password requires a valid email to send the password reset link to.
Changing your email to a valid email requires knowing your password.
If signing up with SSO/token your password is a random string.
You see where this is going...
I'd fix the issue like so:
Don't assign random password for SSO/token login but use empty password.
Don't allow login with empty password obv.
But allow changing your password if it's empty.
If the user forgets their set password and did not set a valid email then idk.
Maybe allow changing the email without entering a password.
Or instead of setting an invaild email (username@username.com) set it to empty and allow changing your password when the email is empty.
However for existing installations the user database is already a mess because of the inconsistently generated emails and passwords....
Also saving the settings did not work for me, I had to edit the php and save them with $this->settings->set