Repository navigation
fix(security): harden login failure responses and authentication state persistence - #160
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## dev #160 +/- ##
==========================================
- Coverage 87.24% 87.19% -0.05%
==========================================
Files 580 580
Lines 18935 18964 +29
Branches 2227 2233 +6
==========================================
+ Hits 16519 16536 +17
- Misses 1614 1621 +7
- Partials 802 807 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR strengthens UltimateAuth's authentication security in two areas:
The changes preserve existing authentication flows, lockout enforcement, and public DTO contracts while introducing safer default behavior and stronger persistence guarantees.
Changes
Login Failure Enumeration Protection
UAuthLoginOptions.IncludeFailureDetailsby default.LoginOrchestrator.InvalidCredentialsresponses without remaining-attempt counts or lockout timestamps when detailed feedback is disabled.Authentication Security State Persistence
UAuthConflictException.NULLS NOT DISTINCTuniqueness for authentication security state records, preventing duplicate account-level rows whereCredentialTypeis null.Database Migrations
Tests
Compatibility
This PR intentionally changes the default public login failure behavior.
Applications that require detailed failure feedback can opt in:
No public authentication DTO types or properties are removed.
Authentication security state persistence changes are internal. Existing login, lockout, and session contracts remain unchanged.
Deployment Notes
Before applying the migration to an existing database:
Scope
This PR does not redesign lockout policies, introduce trusted-device authentication, or change login verification boundaries. Those concerns remain separate from the persistence integrity fixes included here.