Skip to content

Feature/handel multiple attempt password#426

Open
SauravBizbRolly wants to merge 12 commits into
release-3.8.2from
feature/handel_multiple_attempt_password
Open

Feature/handel multiple attempt password#426
SauravBizbRolly wants to merge 12 commits into
release-3.8.2from
feature/handel_multiple_attempt_password

Conversation

@SauravBizbRolly
Copy link
Copy Markdown
Contributor

📋 Description

JIRA ID:
Feature handle multiple attempt password


✅ Type of Change

  • 🐞 Bug fix (non-breaking change which resolves an issue)
  • New feature (non-breaking change which adds functionality)
  • 🔥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 🛠 Refactor (change that is neither a fix nor a new feature)
  • ⚙️ Config change (configuration file or build script updates)
  • 📚 Documentation (updates to docs or readme)
  • 🧪 Tests (adding new or updating existing tests)
  • 🎨 UI/UX (changes that affect the user interface)
  • 🚀 Performance (improves performance)
  • 🧹 Chore (miscellaneous changes that don't modify src or test files)

ℹ️ Additional Information

Please describe how the changes were tested, and include any relevant screenshots, logs, or other information that provides additional context.

snehar-nd and others added 12 commits April 2, 2026 15:21
Mapped ASHA's list is missing in Login API response
setDemographicDetails() was overwriting occupationName (already set
correctly by the mapper from occupationID) with null when no occupation
name string was present in the payload. Added null guards so the mapper's
resolved name is preserved, and explicitly set occupationId/educationId
from i_bendemographics to ensure the IDs always reach Identity-API.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Occupation details getting null in DB
logOutUserFromConcurrentSession only cleaned up old-style Redis session
keys but never added the displaced user's JWT to the denylist. Because
JwtUserIdValidationFilter validates solely via JWT signature and the
denylist, System 1's token remained valid and all APIs returned 200
after System 2 forced a concurrent login.

Fix: store a username→JTI mapping in Redis at login time; during
concurrent-session logout, look up the JTI and add it to the denylist
and evict the user_<id> cache so the next request from System 1 is
rejected with 401 and the frontend shows the session-expiry message.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix: concurrent session logout not invalidating JWT in first system
logOutUserFromConcurrentSession only cleaned up old-style Redis session
keys but never added the displaced user's JWT to the denylist. Because
JwtUserIdValidationFilter validates solely via JWT signature and the
denylist, System 1's token remained valid and all APIs returned 200
after System 2 forced a concurrent login.

The root serialization bug: redisTemplate value serializer is
Jackson2JsonRedisSerializer<User>, so storing a plain String JTI
caused a deserialization failure on retrieval. Fixed by using the
existing StringRedisTemplate bean for the jti: key operations.

Fix:
- Store username->JTI mapping via StringRedisTemplate at login
  (both userAuthenticate and superUserAuthenticate)
- On concurrent-session logout, retrieve the JTI, add it to the
  denylist, evict user_<id> from User cache, and clean up jti: key
- Add getAccessTokenExpiration() to JwtUtil to supply the TTL

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix: concurrent session logout not invalidating JWT on first system
Add generateSecureToken/generateSecureRefreshToken methods that use
userId as sub instead of username. Mobile logins (okhttp User-Agent)
use the secure token — web logins remain unchanged for backward
compatibility. Other services will be migrated one by one.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 2, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 32c89866-0a69-44cf-9a08-6e2ddf87fd71

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/handel_multiple_attempt_password

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 2, 2026

@SauravBizbRolly SauravBizbRolly requested a review from vishwab1 June 3, 2026 05:52
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.

3 participants