Sir Thomas - 79 - Jul 18, 2014

What’s the suggested method for setting a content razor page to be protected?  Should I manually extract the session and check if user.IsAuthenticated and trigger a redirect?

This statement “The behavior of accessing a protected page…” seems to imply that there is a way to flag a page.

I am not sure I necessarily want all my pages to move to a service driven approach yet.  Using content pages with angular for now.


You can just use the 
RedirectIfNotAuthenticated() method on the ViewPage, e.g:

Otherwise if you want to control content on whether they’re authenticated or not you can use the IsAuthenticated property, e.g:

Sir Thomas:

Awesome, works like a charm!