How to make the HTML file access an external JS file but the user acees the file by typing the url

I need to make my login javascript file to be external but I don’t want people to see it since it is a login system and the file contains the username and password

I was thinking about giving a 403 HTTP Error when it gets accessed but the HTML won’t be able to access it