I am working on login system where the scenario is that after 3 failed login tries I have to block user for 24 hours.
- When user provides wrong credentials then I start inserting and counting fail login tries with java program in the following table:
create table FailedLoginTries(
try_id number primary key,
try_date timestamp(0) default sysdate,
lock_date timestamp(0) default sysdate
user_id number references users(user_id) on delete cascade,
attempts number(3),
isLocked number(2)
);
I want to show user if his/her account is locked that:
- How much time left to un-lock account and
- To auto remove locked record from database table
I mean that:
when user made 3 failed tries then account will be marked as 1 that is considered blocked and will remain block till 24 hours. After 24 hours this will be auto un-locked and after unlocking record will be removed from the table
Thanks in anticipation
Best regards