If you're willing to rely on client-side code for authentication, there are better mechanisms, such as
https://en.wikipedia.org/wiki/Secure_Remote_Password_protoco...There is a standard for it, called TLS-SRP, but unfortunately no browser supports it.