Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.net Identity Disable User

Using the new ASP.net Identity in MVC 5, How do we disable a user from logging in? I don't want to delete them, maybe just disable their account for a time period.

Does anyone have any ideas on this as I don't see a status column or anything on the ASPNetUsers table.

like image 572
Loren.Dorez Avatar asked Dec 27 '13 15:12

Loren.Dorez


1 Answers

await userManager.SetLockoutEnabledAsync(applicationUser.Id, true); await userManager.SetLockoutEndDateAsync(DateTime.Today.AddYears(10)); 
like image 107
Helder Gurgel Avatar answered Sep 19 '22 04:09

Helder Gurgel