Login with username

Since the following thread is already closed, I’m continuing here.

I’ve updated our server to the latest versions:
ERPNext: v12.19.0 (version-12)
Frappe Framework: v12.16.2 (version-12)

But the behavior is still the same. Login with the username still doesn’t work. Only when using the email address works (we don’t use the login with mobile number).

Our security settings:
Allow only one session per user
Allow Login using Mobile Number
Allow Login using User Name
Show Full Error and Allow Reporting of Issues to the Developer

Enable Password Policy is turned off.

The console log:

Traceback (most recent call last):
  File "/opt/bench/erpnext/apps/frappe/frappe/app.py", line 54, in application
    init_request(request)
  File "/opt/bench/erpnext/apps/frappe/frappe/app.py", line 125, in init_request
    frappe.local.http_request = frappe.auth.HTTPRequest()
  File "/opt/bench/erpnext/apps/frappe/frappe/auth.py", line 51, in __init__
    frappe.local.login_manager = LoginManager()
  File "/opt/bench/erpnext/apps/frappe/frappe/auth.py", line 105, in __init__
    if self.login()==False: return
  File "/opt/bench/erpnext/apps/frappe/frappe/auth.py", line 126, in login
    self.authenticate(user=user, pwd=pwd)
  File "/opt/bench/erpnext/apps/frappe/frappe/auth.py", line 216, in authenticate
    self.fail('Invalid login credentials')
  File "/opt/bench/erpnext/apps/frappe/frappe/auth.py", line 276, in fail
    raise frappe.AuthenticationError
frappe.exceptions.AuthenticationError
website.js:161:28