Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@heatherfaerber
Copy link
Contributor

Previously the Using State section of README showed an example accessing state object directly in onRedirectCallback:

<AuthKitProvider
      clientId="client_123"
      apiHostname="auth.example.com"
      onRedirectCallback={(state) => {
        // Access your data here
        if (state?.returnTo) {
          window.location.href = state.returnTo;
        }
      }}
    >

This correction shows state being destructured so it can be accessed:

<AuthKitProvider
      clientId="client_123"
      apiHostname="auth.example.com"
      onRedirectCallback={({ state }) => {
        // Access your data here
        if (state?.returnTo) {
          window.location.href = state.returnTo;
        }
      }}
    >

@heatherfaerber heatherfaerber requested a review from nicknisi July 7, 2025 14:10
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Updates the onRedirectCallback example in README.md to correctly demonstrate state object destructuring from the callback parameter.

  • Fixed misleading example in README.md that incorrectly showed direct state access, now properly shows destructuring { state } parameter in onRedirectCallback

1 file reviewed, no comments
Edit PR Review Bot Settings | Greptile

Copy link
Member

@nicknisi nicknisi left a comment

Choose a reason for hiding this comment

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

Thank you!

@nicknisi nicknisi merged commit 4374642 into main Jul 7, 2025
2 checks passed
@nicknisi nicknisi deleted the docs/readme-using-state-object branch July 7, 2025 14:22
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.

3 participants