Don't redirect for StaticFiles

This commit is contained in:
Slendy 2022-09-20 15:18:27 -05:00
parent e4bfab234f
commit 602f0c63d5
No known key found for this signature in database
GPG key ID: 7288D68361B91428

View file

@ -18,6 +18,13 @@ public class UserRequiredRedirectMiddleware : MiddlewareDBContext
return;
}
// Request ends with a path (e.g. /css/style.css)
if (!string.IsNullOrEmpty(Path.GetExtension(ctx.Request.Path)))
{
await this.next(ctx);
return;
}
if (user.PasswordResetRequired && !ctx.Request.Path.StartsWithSegments("/passwordResetRequired") &&
!ctx.Request.Path.StartsWithSegments("/passwordReset"))
{