migrare UI in WebAssembly + integrare Serviciu stocare info pe web + WebToken
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user