Create a mechanism to be redirected if you don't log in using cookie authentication
ASP.NET Create a mechanism for logging in with Cookie Authentication in Core. If you perform each action without logging in, you will be redirected to the login screen.