Skip to content

fix: prevent destructuring error when reading from stored values#584

Open
CEOehis wants to merge 1 commit intoForgeRock:developfrom
CEOehis:fix/auth-url-opts-destructuring
Open

fix: prevent destructuring error when reading from stored values#584
CEOehis wants to merge 1 commit intoForgeRock:developfrom
CEOehis:fix/auth-url-opts-destructuring

Conversation

@CEOehis
Copy link

@CEOehis CEOehis commented Mar 24, 2026

Description

getStoredAuthUrlValues can sometimes return null (e.g when the item is not found in storage) and attempting to destructure the return value causes an uncaught runtime error.

Changes:

  • default to empty object with nullish coallescing before destructuring
  • update getStoredAuthUrlValues type definition to reflect actual return type

This ensures the proper error handling downstream, where state and verifier are checked for undefined values, works as intended rather than crashing on destructuring.

…lues

`getStoredAuthUrlValues` can sometimes return null (e.g when the item is
not found in storage) and attempting to destructure the return value
causes an uncaught runtime error.

Changes:
- default to empty object with nullish coallescing before destructuring
- update `getStoredAuthUrlValues` type definition to reflect actual
return type

This ensures the proper error handling downstream, where `state` and
`verifier` are checked for undefined values, works as intended rather than
crashing on destructuring.
@changeset-bot
Copy link

changeset-bot bot commented Mar 24, 2026

⚠️ No Changeset found

Latest commit: ef4b0a7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ryanbas21
Copy link
Contributor

@CEOehis thanks, the team will look to review this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants