Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
review feedback
  • Loading branch information
rsgowman committed Feb 8, 2021
commit 37bd4e3c7921cb828562be5122b03daac1ef77ff
1 change: 0 additions & 1 deletion etc/firebase-admin.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,6 @@ export namespace auth {
tokensValidAfterTime?: string;
uid: string;
}
{};
}

// @public (undocumented)
Expand Down
5 changes: 3 additions & 2 deletions src/auth/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,8 @@ export class BaseAuth<T extends AbstractAuthRequestHandler> implements BaseAuthI
// but also provides a providerToLink with a 'phone' provider id. In that
// case, we'll throw an error.
properties = deepCopy(properties);
if (validator.isNonNullObject(properties) && typeof properties.providerToLink !== 'undefined') {

if (properties?.providerToLink) {
if (properties.providerToLink.providerId === 'email') {
if (typeof properties.email !== 'undefined') {
throw new FirebaseAuthError(
Expand All @@ -380,7 +381,7 @@ export class BaseAuth<T extends AbstractAuthRequestHandler> implements BaseAuthI
delete properties.providerToLink;
}
}
if (validator.isNonNullObject(properties) && typeof properties.providersToUnlink !== 'undefined') {
if (properties?.providersToUnlink) {
if (properties.providersToUnlink.indexOf('phone') !== -1) {
// If we've been told to unlink the phone provider both via setting
// phoneNumber to null *and* by setting providersToUnlink to include
Expand Down
1 change: 0 additions & 1 deletion test/unit/auth/auth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1674,7 +1674,6 @@ AUTH_CONFIGS.forEach((testConfig) => {
getAccountInfoByUidStub.restore();
});


it('specifying both email and providerId=email should be rejected', () => {
expect(() => {
auth.updateUser(uid, {
Expand Down