Key changes in v4 migration
mainWhen migrating from v3 to v4, note the following behavioral and API changes:
- Edge Compatibility: v4 is edge-compatible by default; the
@auth0/nextjs-auth0/edgeexport has been removed. - Cookie Defaults: All cookies set by the SDK now default to
SameSite=Lax. - Session Management: The
touchSessionmethod has been removed. Rolling sessions are now enabled by default in the middleware. - Access Tokens:
getAccessTokencan now be called directly in React Server Components. - Logout Behavior: v4 uses OpenID Connect's RP-Initiated Logout by default if enabled on your Auth0 tenant; otherwise, it falls back to the
/v2/logoutendpoint. - Customization: Customizing auth handlers via
handleAuthis replaced by Middleware Interception and theonCallbackhook.