diff --git a/web/backend/API/API.Core/API.Core.csproj b/web/backend/API/API.Core/API.Core.csproj
index 6e9825d..4fe70b9 100644
--- a/web/backend/API/API.Core/API.Core.csproj
+++ b/web/backend/API/API.Core/API.Core.csproj
@@ -8,33 +8,27 @@
-
-
-
-
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/web/backend/API/API.Core/Authentication/JwtAuthenticationHandler.cs b/web/backend/API/API.Core/Authentication/JwtAuthenticationHandler.cs
index 3833c64..539c903 100644
--- a/web/backend/API/API.Core/Authentication/JwtAuthenticationHandler.cs
+++ b/web/backend/API/API.Core/Authentication/JwtAuthenticationHandler.cs
@@ -44,29 +44,19 @@ public class JwtAuthenticationHandler(
{
// Use the same access-token secret source as TokenService to avoid mismatched validation.
string? secret = Environment.GetEnvironmentVariable("ACCESS_TOKEN_SECRET");
- if (string.IsNullOrWhiteSpace(secret)) secret = configuration["Jwt:SecretKey"];
+ if (string.IsNullOrWhiteSpace(secret))
+ secret = configuration["Jwt:SecretKey"];
- if (string.IsNullOrWhiteSpace(secret)) return AuthenticateResult.Fail("JWT secret is not configured");
+ if (string.IsNullOrWhiteSpace(secret))
+ return AuthenticateResult.Fail("JWT secret is not configured");
// Check if Authorization header exists
- if (
- !Request.Headers.TryGetValue(
- "Authorization",
- out StringValues authHeaderValue
- )
- )
+ if (!Request.Headers.TryGetValue("Authorization", out StringValues authHeaderValue))
return AuthenticateResult.Fail("Authorization header is missing");
string authHeader = authHeaderValue.ToString();
- if (
- !authHeader.StartsWith(
- "Bearer ",
- StringComparison.OrdinalIgnoreCase
- )
- )
- return AuthenticateResult.Fail(
- "Invalid authorization header format"
- );
+ if (!authHeader.StartsWith("Bearer ", StringComparison.OrdinalIgnoreCase))
+ return AuthenticateResult.Fail("Invalid authorization header format");
string token = authHeader.Substring("Bearer ".Length).Trim();
@@ -81,9 +71,7 @@ public class JwtAuthenticationHandler(
}
catch (Exception ex)
{
- return AuthenticateResult.Fail(
- $"Token validation failed: {ex.Message}"
- );
+ return AuthenticateResult.Fail($"Token validation failed: {ex.Message}");
}
}
@@ -97,7 +85,10 @@ public class JwtAuthenticationHandler(
Response.ContentType = "application/json";
Response.StatusCode = 401;
- ResponseBody response = new() { Message = "Unauthorized: Invalid or missing authentication token" };
+ ResponseBody response = new()
+ {
+ Message = "Unauthorized: Invalid or missing authentication token",
+ };
await Response.WriteAsJsonAsync(response);
}
}
@@ -106,6 +97,4 @@ public class JwtAuthenticationHandler(
/// Options for the JWT authentication scheme handled by .
///
/// No additional options are defined beyond those provided by .
-public class JwtAuthenticationOptions : AuthenticationSchemeOptions
-{
-}
\ No newline at end of file
+public class JwtAuthenticationOptions : AuthenticationSchemeOptions { }
diff --git a/web/backend/API/API.Core/Controllers/NotFoundController.cs b/web/backend/API/API.Core/Controllers/NotFoundController.cs
index 1f3a31e..35c3890 100644
--- a/web/backend/API/API.Core/Controllers/NotFoundController.cs
+++ b/web/backend/API/API.Core/Controllers/NotFoundController.cs
@@ -24,4 +24,4 @@ public class NotFoundController : ControllerBase
{
return NotFound(new { message = "Route not found." });
}
-}
\ No newline at end of file
+}
diff --git a/web/backend/API/API.Core/Controllers/ProtectedController.cs b/web/backend/API/API.Core/Controllers/ProtectedController.cs
index 4efa192..02199d4 100644
--- a/web/backend/API/API.Core/Controllers/ProtectedController.cs
+++ b/web/backend/API/API.Core/Controllers/ProtectedController.cs
@@ -31,8 +31,8 @@ public class ProtectedController : ControllerBase
new ResponseBody