Search code examples
c#.net-coreasp.net-identityregistration

How to limit the maximum registered user count in asp.net core identity


I have just created an asp.net core 3.1 project by selecting the react template for the ui and individual user accounts for the authentication. The requirement I need to meet on the open source project I have just started to work on is preventing multiple registered users. I would like to have this application should have only one registered user. So I have tried to have the identity scaffolding item, but this attempt has just created only the razor files, not the controllers. According to the requirement, I think I need to access to the controllers to limit the maximum registered user count. How can I achieve that?

Thanks,


Solution

  • I've just figured it out. The logic behind the razor views is not in controllers anymore. I found it in the Register.cshtml.cs file.

    enter image description here