Can I lock a user for a while if the user typed the wrong password for several times?

I know that wix can let a user login many times until they typed the right password. I am using a custom login/ sign up page . Is there a way to increase the security of the login system? Anyone can help ,please?

Hey!

Of course, this is a totally code-able cool feature.
You can utilize the user’s local storage for this purpose by planting a cookie that will indicate that the user has tried several times and failed.

Add a function that will check the cookie’s timestamp (add it as one of its properties) to determine when the user is allowed to try again, and of course, remove it when it does.

I’d also suggest adding a recurring job (or some interval in the login page) to trigger this function every once in a while according to the desired logic - in order to automate the process and lift the lock on the user.

Hope that helps!

Doron.

Hi Doron!

Thanks for you nice suggestion . Since I am new to corvid, I don‘t know what to code :pensive:
Where should I put the code to? (Here is my costume login page code)

import wixUsers from ‘wix-users’ ;
import wixLocation from ‘wix-location’ ;
import wixWindow from ‘wix-window’ ;

$w.onReady( function () {
$w( “#forgot” ).onClick( (event) => {
//wixWindow.lightbox.close()
wixUsers.promptForgotPassword()
.then( ( ) => {
//
} )
. catch ( (err) => {
let errorMsg = err; //“The user closed the forgot password dialog”
});
});
});
export function Loginbutton_click(event) {
let email = $w( “#mail” ).value;
let password = $w( “#password” ).value;

wixUsers.login(email, password) 
    .then( () => { 
        console.log( "User is logged in" ); 
        wixUsers.onLogin( (user) => { 

            }) 
        } ) 
    . **catch** ( (err) => { 
        console.log(err); 

//shall I put a location code here or what should I put ?
} );

}

I want to know that what should I put to lock a user . :pray:t2:

Anyone have idea?