Induláskor átmenjen a middlewareon a bejelentkezéshez szükséges elemek
This commit is contained in:
@@ -19,6 +19,16 @@ namespace WorkFlowCheck.Web.Middleware
|
||||
|
||||
public async Task Invoke(HttpContext context)
|
||||
{
|
||||
var pathignore = context.Request.Path;
|
||||
if (pathignore.StartsWithSegments("/css") ||
|
||||
pathignore.StartsWithSegments("/js") ||
|
||||
pathignore.StartsWithSegments("/lib") ||
|
||||
pathignore.StartsWithSegments("/images") ||
|
||||
pathignore.StartsWithSegments("/favicon.ico"))
|
||||
{
|
||||
await _next(context);
|
||||
return;
|
||||
}
|
||||
var token = context.Request.Cookies["AuthToken"];
|
||||
|
||||
if (!string.IsNullOrEmpty(token) && ValidateToken(token, out var claims))
|
||||
|
||||
Reference in New Issue
Block a user