its really simple all you do is copy this code and change it to your varibles and name:
function login () {
if (pname == OwnerId) {
var password = prompt("Password please");
if(password === "imnotshowingyoumypass") {
prompt("Welcome back DaniDaCoder");
textSize(20.5);
text("danidacoder", 282, 43);
}else {
if(password != "imnotshowingyoumypass") {
prompt("you are not danidacoder");
}
}