I broke the login

By mistake I've broken the redirect to login part.

If I manually visit \login the page works, I can login and everything works great.

But somehow if I'm not authenticated and visit the home page the login window is not redirected to.

Can you point me in the direction of the unauthorized redirection code so I can pull just that bit from a backup.

I've tried disabling security and re-enabling it.

The Ouput log is: (when visiting the home page)

dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2 GET https://localhost:5001/ - -

dotnet: info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
      Executing endpoint '/_Host'
info: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[3]
      Route matched with {page = "/_Host", action = "", controller = ""}. Executing page /_Host
info: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[103]
      Executing an implicit handler method - ModelState is Valid
info: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[104]
      Executed an implicit handler method, returned result Microsoft.AspNetCore.Mvc.RazorPages.PageResult.

dotnet: info: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[4]
      Executed page /_Host in 0.4247ms
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
      Executed endpoint '/_Host'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/2 GET https://localhost:5001/ - - - 200 - text/html;+charset=utf-8 0.7743ms

dotnet: info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
      Executed endpoint '/_blazor'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/1.1 GET https://localhost:5001/_blazor?id=1PaLVP6aolu0MSxrWQHCUg - - - 101 - - 170492.2229ms

dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2 POST https://localhost:5001/_blazor/disconnect multipart/form-data;+boundary=----WebKitFormBoundaryYBRBN0oMOvTgF8Ib 359

dotnet: info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
      Executing endpoint 'Blazor disconnect'

dotnet: info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
      Executed endpoint 'Blazor disconnect'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/2 POST https://localhost:5001/_blazor/disconnect multipart/form-data;+boundary=----WebKitFormBoundaryYBRBN0oMOvTgF8Ib 359 - 200 0 - 0.5384ms

dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2 GET https://localhost:5001/assets/css/styles.css - -
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2 GET https://localhost:5001/_framework/blazor.server.js - -
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2 GET https://localhost:5001/_content/Radzen.Blazor/Radzen.Blazor.js - -
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[6]
      The file /_framework/blazor.server.js was not modified

dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/2 GET https://localhost:5001/_framework/blazor.server.js - - - 304 - application/javascript 0.2453ms
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[6]
      The file /assets/css/styles.css was not modified
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[6]
      The file /_content/Radzen.Blazor/Radzen.Blazor.js was not modified
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/2 GET https://localhost:5001/assets/css/styles.css - - - 304 - text/css 0.3751ms
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/2 GET https://localhost:5001/_content/Radzen.Blazor/Radzen.Blazor.js - - - 304 - application/javascript 0.3709ms

dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2 GET https://localhost:5001/assets/css/styles-generated.css - -

dotnet: info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[6]
      The file /assets/css/styles-generated.css was not modified
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/2 GET https://localhost:5001/assets/css/styles-generated.css - - - 304 - text/css 0.2632ms

dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2 GET https://localhost:5001/_content/Radzen.Blazor/css/humanistic.css - -

dotnet: info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[6]
      The file /_content/Radzen.Blazor/css/humanistic.css was not modified
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/2 GET https://localhost:5001/_content/Radzen.Blazor/css/humanistic.css - - - 304 - text/css 0.2112ms

dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2 POST https://localhost:5001/_blazor/negotiate?negotiateVersion=1 text/plain;charset=UTF-8 0

dotnet: info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
      Executing endpoint '/_blazor/negotiate'

dotnet: info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
      Executed endpoint '/_blazor/negotiate'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/2 POST https://localhost:5001/_blazor/negotiate?negotiateVersion=1 text/plain;charset=UTF-8 0 - 200 316 application/json 0.3964ms

dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2 GET https://localhost:5001/_content/Radzen.Blazor/fonts/SourceSansPro-Regular.woff - -

dotnet: info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[6]
      The file /_content/Radzen.Blazor/fonts/SourceSansPro-Regular.woff was not modified
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/2 GET https://localhost:5001/_content/Radzen.Blazor/fonts/SourceSansPro-Regular.woff - - - 304 - application/font-woff 0.3930ms

dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET https://localhost:5001/_blazor?id=EJ352J9tOwvt456fPlmw7Q - -

dotnet: info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
      Executing endpoint '/_blazor'

dotnet: info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[2]
      Authorization failed. These requirements were not met:
      DenyAnonymousAuthorizationRequirement: Requires an authenticated user.
info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[2]
      Authorization failed. These requirements were not met:
      DenyAnonymousAuthorizationRequirement: Requires an authenticated user.

dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2 GET https://localhost:5001/favicon.ico - -

dotnet: info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/favicon.ico'. Physical path: 'C:\Users\chris\OneDrive\Projects\2020 Store Admin\server\wwwroot\favicon.ico'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/2 GET https://localhost:5001/favicon.ico - - - 200 15406 image/x-icon 0.6887ms

Solved:

It was something in the \server\Shared folder.