User feedback when clicking Login

Hello,

This is my site: http://www.chris.photo/
It’s a private site to show to potential clients.

I have used the Wix members centre to lock all pages - as you can’t seem to just lock the whole site with one password so I’m adapting. I just use one account and hide the username field on the login page so all they have to do is enter the password. It’s all working great, except two things.

  1. When you enter the password and click login - it takes a second or two to actually login. It looks like the password is incorrect or the system isn’t working properly. Is there any way of having a loading spinner or a message when login is successful. Maybe one that is collapsed that expands to say ‘Logging in’ - or even have the Login button grey out or some other kind of feedback to show it’s ‘processing’

  2. If they enter the wrong password a second time, how do you clear the previous entry? As the incorrect password error doesn’t disappear after each attempt it would be good to have some kind of feedback on the Login button to say that the password is incorrect again. Or simply the error message disappears after 3 seconds…

THANKS to anyone who can help.

import wixUsers from 'wix-users';
import wixLocation from 'wix-location';
import wixWindow from 'wix-window';

export function loginNow_click(event) {
}

$w.onReady(function(){
    $w('#loginNow').onClick(function (){
 let email = $w('#loginEmail').value;
 let password = $w('#loginPassword').value;
        wixUsers.login(email,password)
        .then(()=>{
        console.log("User is logged in");
            wixWindow.lightbox.close();
            wixLocation.to('/portraits');
        })
    .catch( (err) => {
     console.log(err);
     $w("#errorMessage").expand();
    })
})
})
$w.onReady(function(){
    $w('#loginNow').onClick(function (){
        console.log("START showing SPINNER here")
        let email = $w('#loginEmail').value;
        let password = $w('#loginPassword').value;
        wixUsers.login(email,password)
        .then(()=>{
            console.log("END showing SPINNER here")
            console.log("User is logged in");
            wixWindow.lightbox.close();
            wixLocation.to('/portraits');
        })
        .catch( (err) => {
            console.log(err);
            $w("#errorMessage").expand();
            $w('#loginPassword').value = ""
        })
    })
})

Thank you for replying!! This works to clear the password on incorrect entry. It would still be great to get an answer to question 1 about feedback on the delayed 2 second wait on clicking Login…

Many thanks!!