Skip to content

fix: resolve duplicate error messages on login failure#263

Open
23bsm038-Mahi wants to merge 2 commits intoPSMRI:mainfrom
23bsm038-Mahi:fix/login-error
Open

fix: resolve duplicate error messages on login failure#263
23bsm038-Mahi wants to merge 2 commits intoPSMRI:mainfrom
23bsm038-Mahi:fix/login-error

Conversation

@23bsm038-Mahi
Copy link
Copy Markdown

@23bsm038-Mahi 23bsm038-Mahi commented Mar 20, 2026

🛠️ Summary

Fixes issue where multiple error messages were shown on login failure and improves error handling UX.

✅ Changes

  • Ensured only one error message is displayed on login failure
  • Removed duplicate snackbar/error calls
  • Improved clarity of error messages
  • Resolved merge conflicts with latest upstream

🧪 Testing

  • Invalid login → only one error message shown
  • Error message is clear and consistent
  • App builds successfully

📌 Impact

  • Better user experience
  • Cleaner error handling logic

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 20, 2026

Caution

Review failed

Failed to post review comments

📝 Walkthrough

Walkthrough

The PR updates dependency versions (Angular Material and ngx-bootstrap), adds two ABdm facility mapping service methods, centralizes login error handling with helper functions, implements null-safe session storage access patterns across components, removes an unused environment property, and configures TypeScript path aliases for Common-UI modules.

Changes

Cohort / File(s) Summary
Configuration & Build Setup
package.json, tsconfig.json
Downgraded @angular/material-moment-adapter and ngx-bootstrap versions; added TypeScript path mappings for Common-UI modules.
Session Storage Null-Safety
src/app/app-modules/nurse-doctor/doctor-worklist/doctor-worklist.component.ts, src/app/user-login/service/service.component.ts
Applied null-coalescing fallbacks before parsing session storage data to prevent runtime errors when loginDataResponse is missing.
Login Error Handling Refactor
src/app/user-login/login/login.component.ts
Introduced showLoginError() and getLoginErrorMessage() helpers to centralize error display and message extraction, replacing scattered resetCaptcha() + alert calls with unified error handling across login flows.
HTTP Interceptor Enhancement
src/app/app-modules/core/services/http-interceptor.service.ts
Added isLoginRequest() helper and refactored error rethrow logic to prefer error.error payload extraction for both login and non-login requests.
ABdm Facility Service Methods
src/app/app-modules/registrar/shared/services/registrar.service.ts
Added getMappedFacility() and saveAbdmFacilityForVisit() HTTP methods for ABdm facility mapping and persistence operations.
Environment Configuration
src/environments/environment.local.ts
Removed unused getUserId environment property from local environment configuration.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Dependencies shift and storage grows wise,
With null-safe guards and error replies,
Login flows dance with handlers so bright,
ABdm pathways join the delight,
TypeScript aliases guide the way right! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Fix/login error' is vague and generic, using non-descriptive terms that lack specific context about what aspect of login error handling is being fixed. Revise the title to be more specific and descriptive, such as 'Fix duplicate error messages on login failure' or 'Improve login error handling with centralized message display' to clearly convey the main change.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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

@23bsm038-Mahi 23bsm038-Mahi changed the title Fix/login error fix: resolve duplicate error messages on login failure Mar 25, 2026
@23bsm038-Mahi
Copy link
Copy Markdown
Author

Hi @maintainers,
Updated PR title and ensured all checks are passing.
This PR fixes duplicate login error messages and improves UX.

Could you please review and approve the workflows?

Thanks!

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.

1 participant