fix(org): update type to include undefined#5003
Merged
himself65 merged 1 commit intobetter-auth:canaryfrom Sep 30, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes TypeScript type definitions by explicitly adding | undefined to optional string properties across organization-related route handlers. The changes address type safety issues where optional properties needed explicit undefined typing for better type inference.
- Updates organizationId, teamId, permission, and roleName optional properties to explicitly include undefined in their union types
- Adds missing metadata type inference for the listOrgRoles query parameters
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crud-org.ts | Updates organizationId type to include explicit undefined |
| crud-members.ts | Updates organizationId and teamId types to include explicit undefined |
| crud-invites.ts | Updates organizationId type to include explicit undefined |
| crud-access-control.ts | Updates multiple optional properties and adds missing metadata for listOrgRoles |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
packages/better-auth/src/plugins/organization/routes/crud-access-control.ts
Show resolved
Hide resolved
better-auth
@better-auth/cli
@better-auth/core
@better-auth/expo
@better-auth/sso
@better-auth/stripe
commit: |
|
@himself65 is attempting to deploy a commit to the better-auth Team on Vercel. A member of the Team first needs to authorize it. |
himself65
added a commit
to himself65/better-auth
that referenced
this pull request
Oct 2, 2025
himself65
added a commit
to himself65/better-auth
that referenced
this pull request
Oct 2, 2025
himself65
added a commit
that referenced
this pull request
Oct 2, 2025
This was referenced Oct 6, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes: #4804
Summary by cubic
Update organization route types to correctly treat optional fields as possibly undefined. This fixes TypeScript inference issues and prevents errors when optional values are omitted.