I am building a site with a mixture of public and member-only pages. The login system works fine as it is.
However I'd like to launch a closed, invite-only preview and temporarily require visitors log in for all actions except the welcome page.
Currently I have [Authorize]
attributes on certain action methods. I could add additional attributes to the other action methods too, but this feels a bit hacky and will make it harder to remove them correctly later when I want to revert to having more open content.
So, how can I effectively add a site-wide authorisation requirement? Recall that I want the single /Home/Index
route to remain public as well, so that people I've invited can read some information before activating their invites.