Skip to content

fix(auth): Decouple CreateRequest interface from UpdateRequest#3165

Merged
jonathanedey merged 2 commits into
v14from
je-auth-user
May 28, 2026
Merged

fix(auth): Decouple CreateRequest interface from UpdateRequest#3165
jonathanedey merged 2 commits into
v14from
je-auth-user

Conversation

@jonathanedey
Copy link
Copy Markdown
Collaborator

@jonathanedey jonathanedey commented May 28, 2026

By inheriting UpdateRequest, CreateRequest unintentionally exposes type definitions and optional nullable contracts designed strictly for user update requests. This results in misleading and incompatible type definitions.

This PR explicitly defines independent property fields on the CreateRequest interface rather than extending UpdateRequest. This resolves misleading and incompatible type inheritance between user creation and user update workflows by:

  • Removing providerToLink and providersToUnlink property fields from CreateRequest.
  • Removing null type from the displayName, photoURL, and phoneNumber property fields in CreateRequest.

Fixes: #2450, #2929, #3152
Supersedes and closes: #2930

@jonathanedey jonathanedey added the release:stage Stage a release candidate label May 28, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the CreateRequest interface in both etc/firebase-admin.auth.api.md and src/auth/auth-config.ts so that it no longer extends UpdateRequest. Instead, the interface now explicitly defines its own properties, including disabled, displayName, email, emailVerified, password, phoneNumber, and photoURL. There are no review comments to evaluate, and I have no additional feedback to provide.

Copy link
Copy Markdown
Member

@lahirumaramba lahirumaramba left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM!

@jonathanedey jonathanedey merged commit c3d58e4 into v14 May 28, 2026
14 checks passed
@jonathanedey jonathanedey deleted the je-auth-user branch May 28, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:stage Stage a release candidate release-note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

auth.createUser() incorrect types: cannot link provider on account creation

3 participants