Equipment is kész.

This commit is contained in:
2025-03-20 13:12:05 +01:00
parent bd60138a89
commit ae7ba2342e
19 changed files with 639 additions and 79 deletions
+10 -2
View File
@@ -75,8 +75,16 @@ app.UseAuthorization();
app.Use(async (context, next) =>
{
if (string.IsNullOrEmpty(context.User?.Identity?.Name) &&
context.Request.Path == "/")
//if (string.IsNullOrEmpty(context.User?.Identity?.Name) &&
// context.Request.Path == "/")
//{
// context.Response.Redirect("/Account/Login");
// return;
//}
var isAuthenticated = context.User?.Identity?.IsAuthenticated == true;
var path = context.Request.Path.Value?.ToLower();
if (!isAuthenticated && !path.StartsWith("/account/login"))
{
context.Response.Redirect("/Account/Login");
return;