Skip to content
This repository has been archived by the owner on Dec 20, 2018. It is now read-only.

What is considered best practice for disabling / deactivating users? #1858

Closed
egmfrs opened this issue Jul 3, 2018 · 1 comment
Closed
Labels
Milestone

Comments

@egmfrs
Copy link

egmfrs commented Jul 3, 2018

I would define disabling / deactivating a user as having a property held against that user which prevented them from being able to log into the application when the property had been set to a certain value.

We are building an admin section where admin members can disable / re-enable users as required.

The options I have identified:

  1. Set email confirmed to false. To re-activate a user, regenerate an email confirmation link for them.
    Or
  2. Set Lockout Enabled to True and Lockout End to DateTime.Max
    Or
  3. Add IsEnabled field to AspNetUsers (default to True) and override SignInManager to check value is True before returning a Success result.

Are there any other options / which is the most recommended?

@HaoK HaoK added the question label Jul 5, 2018
@HaoK HaoK added this to the Discussions milestone Jul 5, 2018
@HaoK
Copy link
Member

HaoK commented Jul 5, 2018

All of these should work, there was some effort around making it easy to do via SignInManager's CanSignIn method, so 3 is probably closest to how we envisioned something like this working, but the other two options seem reasonable as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants