I am creating a function that checks the user's username and password. When I enter the username and password correctly, the program outputs the correct string. Then, when I enter the incorrect username OR password, the correct while loop is output. However, when I try to enter the correct username after the while loop, I get an infinite loop of my while loop contents.
What is causing this infinite loop when entering the username a second time?
Here is the function I am working on:
void CheckUserPermissionAccess()
{
    int userPassInput;
    string usernameInput;
    string user1 = "Bob Jones";
    string user2 = "Sarah Davis";
    string user3 = "Amy Friendly";
    string user4 = "Johnny Smith";
    string user5 = "Carol Spears";
    int BobPass = 9874;
    int SarahPass = 3478;
    int AmyPass = 2991;
    int JohnnyPass = 5503;
    int CarolPass = 2814;
    cout << "Enter your username: " << endl;
    getline(cin, usernameInput); 
    cout << "Enter your password: " << endl;
    cin >> userPassInput;
    if (usernameInput == user1 && userPassInput == BobPass)
    {
        cout << "password accepted" << endl;
        cout << endl;
    }
    else if (usernameInput == user2 && userPassInput == SarahPass)
    {
        cout << "password accepted" << endl;
        cout << endl;
    }
    else
    {
        while (usernameInput != user1 || userPassInput != BobPass)
        {
            cout << "Invalid Username or Password. Please try again" << endl;
            cout << "Enter your username: " << endl;
            getline(cin, usernameInput);
            cout << "Enter your password: " << endl;
            cin >> userPassInput;
        }
    }
    return;
}
Here is a small part of the infinite loop that gets displayed after entering the username a second time:
Invalid Password. Please try again
Enter your username: 
Enter your password: 
Invalid Password. Please try again
Enter your username: 
Enter your password: 
Invalid Password. Please try again
Enter your username: 
Enter your password: 
Invalid Password. Please try again
Enter your username: 
Enter your password: 
Invalid Password. Please try again
Enter your username: 
Enter your password: 
Invalid Password. Please try again
 
     
     
    