Example #1
0
        public async Task InvokeAsync(HttpContext context, IAppSignInManager signInManager)
        {
            if (context.User.IsInRole("blocked"))
            {
                await signInManager.SignOutAsync();

                context.Response.Redirect("/Home/Blocked");
            }
            await _next.Invoke(context);
        }
Example #2
0
        public async Task <IActionResult> SignOut()
        {
            await signInManager.SignOutAsync();

            return(RedirectToAction(nameof(Home.Index), nameof(Home)));
        }