mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-18 23:42:28 +00:00
Fix bug in user redirection middleware
This commit is contained in:
parent
602f0c63d5
commit
b7c4f17298
1 changed files with 9 additions and 3 deletions
|
@ -25,10 +25,16 @@ public class UserRequiredRedirectMiddleware : MiddlewareDBContext
|
|||
return;
|
||||
}
|
||||
|
||||
if (user.PasswordResetRequired && !ctx.Request.Path.StartsWithSegments("/passwordResetRequired") &&
|
||||
!ctx.Request.Path.StartsWithSegments("/passwordReset"))
|
||||
if (user.PasswordResetRequired)
|
||||
{
|
||||
ctx.Response.Redirect("/passwordResetRequired");
|
||||
if (!ctx.Request.Path.StartsWithSegments("/passwordResetRequired") &&
|
||||
!ctx.Request.Path.StartsWithSegments("/passwordReset"))
|
||||
{
|
||||
ctx.Response.Redirect("/passwordResetRequired");
|
||||
return;
|
||||
}
|
||||
|
||||
await this.next(ctx);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue