feat(web): Simplify Setup, Add Session Check & Fix Missing Refresh Token #1303
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.
This pull request introduces several key improvements to the web platform integration, focusing on simplifying developer setup, enhancing session management, and resolving a common configuration issue.
Simplified Web Dependency Management:
@auth0/auth0-spa-js
library has been moved from an optionalpeerDependency
to a directdependency
.MIGRATION_GUIDE.md
andREACT_NATIVE_WEB_SETUP.md
has been updated to reflect this change.Automatic Silent Authentication on Load:
checkWebSession()
method has been added to theIWebAuthProvider
interface.auth0-spa-js
'scheckSession()
functionality, which typically uses a silent iframe-based mechanism.useRefreshTokens
Behavior on WebuseRefreshTokens
option inWebAuth0Client
has been changed fromtrue
tofalse
.@auth0/auth0-react
and prevents out-of-the-box "Missing Refresh Token" errors for users who have not configured Refresh Token Rotation in their Auth0 application settings. This makes the use of refresh tokens an explicit opt-in, leading to a smoother initial setup.{ useRefreshTokens: true }
when initializing theAuth0
client orAuth0Provider
.Fixed
useRefreshTokens
behavior tofalse
. This aligns the library with the default Auth0 Application settings, preventing errors for new users. Fixes #(5.0.0-beta.4 web support issue #1275).Testing
Dependency Simplification:
react-native-auth0
.npm install @auth0/auth0-spa-js
. The application should build and run correctly.Silent Session Check:
checkWebSession
successfully restored the session.Refresh Token Default:
useRefreshTokens
option), log in and inspect the credentials. A refresh token should not be present.useRefreshTokens: true
and ensure "Refresh Token Rotation" is enabled in your Auth0 dashboard.Checklist