Base solution for your next web application
Open Closed

Do not allow user to login if the last logon date was over X number of days #9533


User avatar
0
sumitshah created

hello team,

I need to implement the following functionality, how can we go ahead?

Do not allow user to login if the last logon date was over X number of days

We have the AbpUserLoginAttempts table from where I can get the creation time and compare with the X configured days. If the latest creation time is greater than X configured days, I need to lock the user and show a message on the UI

The catch here is, If I user the creation time of the AbpUserLoginAttempts for the validation and if the validation fails, we lock the user. The admin will unlock the user but then next time the user tries to login again, as there has been no new entry in the AbpUserLoginAttempts table, the user will again be locked.

Please help me out.


1 Answer(s)
  • User Avatar
    0
    zony created
    Support Team

    Hi sumitshah, If you need to rely on AbpUserLoginAttempts, then you can add a new record when unlocking, so that the user can log in again within a specified time.