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 PR adds support for Auth0 Organizations feature to the
nextjs-auth0
SDK, allowing developers to specify which organization users should authenticate against. The implementation follows Auth0's ecosystem patterns by removing client-side validation and trusting Auth0's server-side validation, aligning withauth0-spa-js
andauth0-react
libraries.📋 Changes
Core Implementation:
organization
parameter support in authorization flowUser
andAuthorizationParameters
interfacesAPI Changes:
handleLogin
method now accepts and passes throughorganization
parameter from URL query stringsAuthorizationParameters
interface includes optionalorganization
field for static configurationUser
interface includes optionalorg_id
field populated after organization-based authenticationTest Coverage:
File Changes:
Changed
src/server/auth-client.ts
: organization parameter pass-through logicChanged
src/types/index.ts
: TypeScript definitions for organization supportAdded
tests/organizations.test.ts
: comprehensive organization feature testsAdded
tests/organization-parameter-passthrough.test.ts
: Auth0 ecosystem alignment validationAdded
tests/organizations-live.test.ts
: live integration testing capabilities🎯 Testing
Automated:
audience
,scope
,returnTo
)Manual:
?organization=org_id
parameterauthorizationParameters
Compatibility:
📎 References