Skip to content

Conversation

@joshtrichards
Copy link
Member

@joshtrichards joshtrichards commented Dec 31, 2025

  • Resolves: #

Summary

Rewrites the beforeController for improved clarity and maintainability while preserving all intended/existing behaviors:

  • removes the extra nesting and indirection
  • eliminates redundant code paths
  • breaks out all bypasses returns clearly
  • restructures conditional checks for readability
  • adds helpful, consistent inline comments throughout
  • adds useful, but still brief class and method level doc blocks

No logic is missing or altered in a way that would break original policy:

  • Bypass and enforcement flows are consistent.
  • All existing controller/method name checks, user session logic, provider enforcement, etc., are fully represented
  • All edge case behavior is preserved

TODO

Checklist

Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards joshtrichards changed the title fix(core): refactor TwoFactorMiddleware for clarity and maintainability refactor(core): rewrite TwoFactorMiddleware for clarity and maintainability Dec 31, 2025
@joshtrichards joshtrichards changed the title refactor(core): rewrite TwoFactorMiddleware for clarity and maintainability refactor(core): improve TwoFactorMiddleware clarity and maintainability Dec 31, 2025
Signed-off-by: Josh <josh.t.richards@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants