migrare UI in WebAssembly + integrare Serviciu stocare info pe web + WebToken

This commit is contained in:
andrei-mihnea-cerbu
2024-04-10 06:57:48 +03:00
parent 9977a9b5f5
commit adba50e70b
1915 changed files with 16113 additions and 99991 deletions
+8 -6
View File
@@ -18,17 +18,19 @@ public class JwtMiddleware
public async Task Invoke(HttpContext context)
{
var path = context.Request.Path.ToString().ToLower();
// Define the paths that should bypass JWT validation
var bypassPaths = new[]
{
"/api/doctors/login",
"/api/authorization/login",
"/api/doctors/register",
"/api/patients/login",
"/api/patients/register"
"/api/patients/register",
"/api/authorization/reset_password"
};
if (!bypassPaths.Contains(path))
if (bypassPaths.Contains(path))
{
await _next(context);
}
else
{
var token = context.Request.Headers["Authorization"].FirstOrDefault()?.Split(" ").Last();
if (token != null && _jwtService.ValidateJwtToken(token))