Hi Mike,
First of all, I believe your mistake was, that you add at the lightbox an login element instead of a regular button that it’s event is going to be the entry to the site.

This element automatic redirected you, to the wix login page while pressing on login.
Second, you correct ,at my example I only reference to the signup button.
The following code runs while clicking on the login button at the llightbox :
pay attention, if you use this example write the functions logIn_click() and signUp_click() inside the lightbox’s page, and the functions logInButtton_click() (that open the lightbox) and logout_click() at the entry page .

import wixUsers from 'wix-users';
export function logIn_click(event) {
const email = $w('#email').value;
const password = $w('#password').value;
wixUsers.login(email, password) . //if the member exist in the member . list, the lightbox will close and you will return to the preview page.
.then(() => {
console.log("User is logged in");
wixWindow.lightbox.close();
})
.catch(err => {
console.log(err)
})
}
Hope its help!
Have a nice day and best of luck!
Sapir