Skip to content

fix: authorize session null handling in authorizeSession callback and setResultUrl#47

Merged
chaitanyapotti merged 2 commits intomasterfrom
fix/authorizeSession_null_handling
Mar 20, 2026
Merged

fix: authorize session null handling in authorizeSession callback and setResultUrl#47
chaitanyapotti merged 2 commits intomasterfrom
fix/authorizeSession_null_handling

Conversation

@grvgoel81
Copy link
Copy Markdown
Contributor

@grvgoel81 grvgoel81 commented Mar 19, 2026

Motivation and Context

Jira Link:

Description

  • Fix: authorize session null handling in authorizeSession callback and setResultUrl

How has this been tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes 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)

Checklist:

  • My code follows the code style of this project. (run lint)
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My code requires a db migration.

Note

Medium Risk
Touches the login/session authorization path and adds early-return behavior when session/store payloads are missing, which could change when callbacks fire in edge cases but is limited to null/invalid-response handling.

Overview
Improves robustness of session authorization and redirect processing by adding defensive null/empty checks and safer JSON parsing.

Web3AuthApi.authorizeSession now treats missing/empty response bodies or deserialization failures as null responses instead of throwing. Web3Auth.setResultUrl and authorizeSession now validate sessionId, store message, required ShareMetadata fields, decrypted JSON, and userInfo fields before proceeding, logging warnings/errors and returning early when data is incomplete (e.g., passwordless flows where the session may not be ready yet).

Written by Cursor Bugbot for commit c2d76a2. Configure here.

…s in authorizeSession callback and setResultUrl

Made-with: Cursor
@grvgoel81 grvgoel81 self-assigned this Mar 19, 2026
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

@chaitanyapotti chaitanyapotti merged commit 4d0e78f into master Mar 20, 2026
3 checks passed
@chaitanyapotti chaitanyapotti deleted the fix/authorizeSession_null_handling branch March 20, 2026 04:19
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.

2 participants