You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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: DateTime.UtcNow.AddDays(-5)
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: