ASP.NET Core MVC - Attribute and ActionFilter (6)

Опубликовано: 16 Июль 2026
на канале: Ahmad Gabari
150
3

In this video we've learned how to protect views / action to be accessible only when user is logged in by using SessionFiler (Attribute, IActionFilter). By overriding OnActionExecuting of IActionFilter interface we could check the session from HttpContext and returns AccessDenied page in case the user is not logged in.

Previous:    • ASP.NET Core MVC - Login with Session (5)  
Next:    • ASP.NET Core MVC - Password Hasher/Encryot...  
Code snippet: https://drive.google.com/file/d/1r-aj...