0

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,

xkcd
  • 2,538
  • 11
  • 59
  • 96
  • Its not clear what you mean by "each instance of this application should have only one active user" given that it is an ASP.NET project. Traditionally, a web application is meant to allow for a large number of simultaneous users. Could you expand on the requirement please so we can better target the advice? – Peter Lange Nov 08 '20 at 01:39
  • @PeterLange updated my question, sorry for being not clear. – xkcd Nov 08 '20 at 11:48
  • Why do you have such requirement? What is the real problem behind it? – Vlad DX Nov 08 '20 at 12:06
  • @VladimirSerykh Think this as a personal blog. The registered user will be the admin / owner and will provide content. And the non registered users of the system will just browse the provided content. – xkcd Nov 08 '20 at 12:25
  • This is what I understood from your question, scaffold has created only razor files not the controller so you are confused where should you add logic to limit registration? – Aakash Nov 08 '20 at 15:34
  • @Aakash exactly – xkcd Nov 08 '20 at 19:11

1 Answers1

0

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

xkcd
  • 2,538
  • 11
  • 59
  • 96