feat: Send lockExcludedAuthPartners during auth lock for Resident Portal (#1566)#899
feat: Send lockExcludedAuthPartners during auth lock for Resident Portal (#1566)#899Shushmitaaaa wants to merge 2 commits into
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 44 minutes and 17 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
…ortal (AC8, AC9, AC10, AC11) Signed-off-by: Shushmita <Shushmitat39@gmail.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@resident-ui/src/app/feature/uinservices/lockunlockauth/lockunlockauth.component.ts`:
- Around line 230-235: The JSON.parse of exclusionConfig can throw and must be
guarded: in lockunlockauth.component.ts around the
exclusionConfig/exclusionSupportedTypes assignment, wrap
JSON.parse(exclusionConfig) in a try/catch and fall back to an empty array on
error (and optionally log or warn via the component logger or AppConfig
service). Ensure you keep the current behavior when exclusionConfig is falsy,
and only replace the raw JSON.parse call that initializes
exclusionSupportedTypes with the safe parse + fallback logic while referencing
the existing exclusionConfig variable and exclusionSupportedTypes identifier.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 175c34ff-66dc-4eb0-9db8-f2532e784a3a
📒 Files selected for processing (1)
resident-ui/src/app/feature/uinservices/lockunlockauth/lockunlockauth.component.ts
7f016da to
ff452d3
Compare
…AC11) Signed-off-by: Shushmita <Shushmitat39@gmail.com>
Implements the Angular/UI side of the authentication lock exclusion mechanism for the Resident Portal.
Problem
When a resident locks all auth types, they get deadlocked out of the portal with no way to recover.
Changes
lockunlockauth.component.ts — Modified updateAuthlockStatus() to attach lockExcludedAuthPartners: ["resident-partner"] to the lock payload, only for auth types listed in the exclusion config and only during lock (not unlock). Non-matching auth types behave exactly as before.
app-config.service.ts — Added mapping for resident.auth-types-groups.exclusion-for-resident-login and mosip-resident-service-partner-id from the backend config endpoint.
Acceptance Criteria covered
AC8 ✅ lockExcludedAuthPartners sent during lock operations
AC9 ✅ Partner ID sourced from mosip-resident-service-partner-id config, not hardcoded
AC10 ✅ Supported auth types driven by resident.auth-types-groups.exclusion-for-resident-login
AC11 ✅ If config absent, falls back to existing behavior
AC13 ✅ Unlock flow and non-excluded auth types untouched
Linked Issue: mosip/resident-services#1566
Summary by CodeRabbit