Thanks to visit codestin.com
Credit goes to github.com

Skip to content

refactor: Use RequiredField utility for username enforcement in API endpoint context type#39306

Merged
ggazzo merged 2 commits intochore/username-apifrom
copilot/sub-pr-39266
Mar 3, 2026
Merged

refactor: Use RequiredField utility for username enforcement in API endpoint context type#39306
ggazzo merged 2 commits intochore/username-apifrom
copilot/sub-pr-39266

Conversation

Copy link
Contributor

Copilot AI commented Mar 3, 2026

The second conditional user type block in definition.ts was still using the verbose Omit<IUser, 'username'> & Required<Pick<IUser, 'username'>> pattern instead of the RequiredField utility already imported and applied elsewhere in the same file.

Changes

  • apps/meteor/app/api/server/definition.ts: Replace Omit<IUser, 'username'> & Required<Pick<IUser, 'username'>> with RequiredField<IUser, 'username'> at both occurrences in the TOptions['authRequired'] conditional type block
// Before
user: TOptions extends { userWithoutUsername: true } ? IUser : Omit<IUser, 'username'> & Required<Pick<IUser, 'username'>>;

// After
user: TOptions extends { userWithoutUsername: true } ? IUser : RequiredField<IUser, 'username'>;

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Mar 3, 2026

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Mar 3, 2026

⚠️ No Changeset found

Latest commit: 1fae26b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI changed the title [WIP] Update stacked PR to enforce username in endpoint context refactor: Use RequiredField utility for username enforcement in API endpoint context type Mar 3, 2026
@ggazzo ggazzo marked this pull request as ready for review March 3, 2026 19:09
@ggazzo ggazzo requested a review from a team as a code owner March 3, 2026 19:09
@ggazzo ggazzo merged commit 86e63ed into chore/username-api Mar 3, 2026
2 checks passed
@ggazzo ggazzo deleted the copilot/sub-pr-39266 branch March 3, 2026 19:09
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants