That’s the thing, without the server side code that’s being used set up it’s impossible to determine what the js will need to be. It’s like trying to build the walls of a house before the foundation is poured.
The server side code for logging in should be fairly simple.
If the user name and md5(password) match against the database it writes a session for the user
Are there other factors I’m not thinking of?