How to Get a Login Function to Work Locally?

So I am making this program for my Dad to use at work so he can take Inventory on Items and a few other things. What I want to do is create a Login system that doesn’t use network functionality it just checks if the fields are correct and loads the program. Currently what I have seems to work for getting the correct Login but I cannot get it to detect an incorrect Login. My current Script looks like this.
var userToEdit : String;
var passwordToEdit : String;
var customSkin : GUISkin;
var correctLogin : boolean = false;

function Start () {

}

function Update () 
{
	if(userToEdit == "User" && passwordToEdit == "password")
		{
			correctLogin = true;
		}
	else
		{
			correctLogin = false;
		}
}

function OnGUI ()
{
GUI.skin = customSkin;

	userToEdit = GUI.TextField(Rect (Screen.width/ 2 - 50,Screen.height/2,200,20), userToEdit, 25);

	passwordToEdit = GUI.PasswordField(Rect (Screen.width/2 - 50,Screen.height/2 + 25,200,20), passwordToEdit, "*"[0], 25);
	
	if(GUILayout.Button("Login", "button") && correctLogin == true)
	{
		Debug.Log("This Button Works!");
	}
	else
	{
		Debug.Log("Login Failure");
	}
	
}

Originally there wasn’t a boolean but I added it to see if it would work better to no avail. What I think is the issue is that the Button I create isn’t a permanent object and I cannot reference it outside of that one line of code. How can I make it so if the User and Password are incorrect and I click the Login button it will display “Incorrect Login” in the Debug Log? Any help will be very much appreciated :slight_smile:

if(GUILayout.Button(“Login”, “button”))
{
if(correctLogin)
{
Debug.Log(“This Button Works!”);
}
else
{
Debug.Log(“Login Failure”);
}
}