Skip to content

Commit

Permalink
fix for lock user account when db provider is PostreSql (#2647)
Browse files Browse the repository at this point in the history
fix: fix for lock user account when db provider is PostreSql
  • Loading branch information
afedorov1971 committed Apr 25, 2023
1 parent 2ed0191 commit 9d83950
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ public async Task<ActionResult<SecurityResult>> LockUser([FromRoute] string id)
var user = await UserManager.FindByIdAsync(id);
if (user != null)
{
var result = await UserManager.SetLockoutEndDateAsync(user, DateTime.MaxValue);
var result = await UserManager.SetLockoutEndDateAsync(user, DateTime.MaxValue.ToUniversalTime());
return Ok(result.ToSecurityResult());
}

Expand All @@ -825,7 +825,7 @@ public async Task<ActionResult<SecurityResult>> UnlockUser([FromRoute] string id
if (user != null)
{
await UserManager.ResetAccessFailedCountAsync(user);
var result = await UserManager.SetLockoutEndDateAsync(user, DateTimeOffset.MinValue);
var result = await UserManager.SetLockoutEndDateAsync(user, DateTimeOffset.MinValue.ToUniversalTime());
return Ok(result.ToSecurityResult());
}

Expand Down

0 comments on commit 9d83950

Please sign in to comment.