From 5ca32bbbaf3ab58a2eccb9d909bd36e17325d794 Mon Sep 17 00:00:00 2001 From: MahanCh Date: Tue, 29 Jul 2025 14:06:38 +0330 Subject: [PATCH] Add Redirect If the User is Authenticated in Home Screen --- ServiceHost/Pages/Index.cshtml.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ServiceHost/Pages/Index.cshtml.cs b/ServiceHost/Pages/Index.cshtml.cs index 0be15164..7ede123f 100644 --- a/ServiceHost/Pages/Index.cshtml.cs +++ b/ServiceHost/Pages/Index.cshtml.cs @@ -17,8 +17,11 @@ namespace ServiceHost.Pages _accountApplication = accountApplication; } - public void OnGet() + public IActionResult OnGet() { + if(_authHelper.IsAuthenticated()) + return Redirect("/login"); + return Page(); } public IActionResult OnGetLogout()