-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lockout doesn't work #15
Comments
oh.. great works. thank you. |
It turns out my code does not work either :-) The date to return must be in the past. If you set it to DateTime.UtcNow it is considered current when it's checked later in the code since the code gets executed within the same second. In my tests I had a breakpoint that delayed the execution for more than 1 second so that's why I though everything worked fine. A better approach is to make sure the returned date is in the past like this: The above code works fine in all scenarios. Best regards, Harris |
Hi,
Loved your code. Very helpful.
One issue had me puzzled for sometime now. The user lockout (after x tries) does not work.
After debugging your code I found that the following code should be fixed wherever it occurs in UsetTable.cs
user.LockoutEndDateUtc = string.IsNullOrEmpty(row["LOCKOUTENDDATEUTC"]) ? DateTime.Now : DateTime.Parse(row["LOCKOUTENDDATEUTC"]);
should be
user.LockoutEndDateUtc = string.IsNullOrEmpty(row["LOCKOUTENDDATEUTC"]) ? DateTime.UtcNow : DateTime.Parse(row["LOCKOUTENDDATEUTC"]);
Hope I helped a bit.
Best regards,
Harris
The text was updated successfully, but these errors were encountered: