feat[client-js]: Adds React Router v8 sample app for @okta/okta-react-client-js - #322
Draft
BenjaminTruong-okta wants to merge 3 commits into
Draft
Conversation
…/client-js Exercises the opt-in loader factories (createFetchLoader, createTokenLoader, createLoginCallbackLoader) end-to-end against a real Okta org, and resets the sign-in flow's stuck `inProgress` state on a back/forward-cache restore so an abandoned redirect doesn't block starting a new one. Co-Authored-By: Claude Code
| { | ||
| path: '/resource', | ||
| element: <Resource />, | ||
| loader: createFetchLoader(fetchClient, () => userInfoUrl), |
Contributor
There was a problem hiding this comment.
I think using the userInfo URL is a bit confusing. It's an OAuth endpoint, so a developer should use OAuth2 to request it, not a FetchClient. Maybe instead use a static JSON blob and can be hosted via vite to illustrate this?
| "strict": true, | ||
| "forceConsistentCasingInFileNames": true, | ||
| "module": "ESNext", | ||
| "moduleResolution": "Bundler", |
Contributor
There was a problem hiding this comment.
Is Bundler required for this to work? Bundler is usually not recommended
Contributor
Author
There was a problem hiding this comment.
yeah, react-router@8.3.0's package.json only defines an exports map (no main/module/types fallback), so classic "Node" resolution can't find its types at all
…rinfo endpoint Hand-building the userinfo URL bypassed the SDK's own OAuth2Client/Credential userInfo() methods, which resolve the endpoint from OIDC discovery metadata. Swap the sample's /resource route to a plain static JSON file so it just demonstrates createFetchLoader without duplicating SDK logic.
…m vite.config.js A clean build doesn't reproduce this react-router warning - it was vestigial from an earlier scaffolding iteration. Restore the unconditional onwarn throw, matching test-harness-app's convention.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Exercises the opt-in loader factories (createFetchLoader, createTokenLoader, createLoginCallbackLoader) end-to-end against a real Okta org, and resets the sign-in flow's stuck
inProgressstate on a back/forward-cache restore so an abandoned redirect doesn't block starting a new one.PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Reviewers