Skip to content

fix:return access_denied for no matching credential#643

Open
MadhuMosip wants to merge 2 commits into
inji:developfrom
MadhuMosip:bugfix/error-code-response
Open

fix:return access_denied for no matching credential#643
MadhuMosip wants to merge 2 commits into
inji:developfrom
MadhuMosip:bugfix/error-code-response

Conversation

@MadhuMosip
Copy link
Copy Markdown
Contributor

@MadhuMosip MadhuMosip commented May 25, 2026

Closes #642

Summary by CodeRabbit

  • Bug Fixes
    • Standardized and clarified error messaging when a verifier rejection occurs. Users now see a clearer, consistent message stating that no matching credentials were found to fulfill the request, improving guidance during credential presentation and authentication.

Review Change Stack

Signed-off-by: Madhuravas reddy <madhu@mosip.io>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ba3f538c-44b9-436f-9469-3cb3f514bdf4

📥 Commits

Reviewing files that changed from the base of the PR and between fa59dc0 and 03cfb3f.

📒 Files selected for processing (2)
  • inji-web/src/__tests__/modals/NoMatchingCredentialsModal.test.tsx
  • inji-web/src/modals/NoMatchingCredentialsModal.tsx

Walkthrough

The PR changes the rejection payload used when no matching credentials exist: NoMatchingCredentialsModal now sends errorCode: "access_denied" with errorMessage: "No matching credentials found to fulfill the request.". Tests are updated to assert the new payload in both verifier-rejection and redirect-success scenarios.

Changes

Credential Mismatch Error Handling

Layer / File(s) Summary
Update no-matching-credentials error code and message
inji-web/src/modals/NoMatchingCredentialsModal.tsx, inji-web/src/__tests__/modals/NoMatchingCredentialsModal.test.tsx
The rejection payload sent by NoMatchingCredentialsModal now uses errorCode: "access_denied" with errorMessage: "No matching credentials found to fulfill the request.". Test assertions in the verifier-rejection and redirect-success tests are updated to validate the new error payload.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I nibbled at a modal late at night,
Swapped codes and fixed the error's bite.
Now when no creds can meet the quest,
"access_denied" speaks, trimmed and blessed.
A tidy patch — the wallet sleeps alright.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: updating error code from invalid_transaction_data to access_denied for the no matching credentials scenario.
Linked Issues check ✅ Passed The changes directly address issue #642 by updating the error code to 'access_denied' and adjusting the error message as required in the linked issue.
Out of Scope Changes check ✅ Passed All changes are within scope: the modifications update the error code and message in the NoMatchingCredentialsModal component and its corresponding tests, directly addressing the linked issue requirement.
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

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.

Signed-off-by: Madhuravas reddy <madhu@mosip.io>
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