diff --git a/lib/build/user.js b/lib/build/user.js index 5179ebc6f..480f66b89 100644 --- a/lib/build/user.js +++ b/lib/build/user.js @@ -20,6 +20,9 @@ class LoginMethod { this.verified = loginMethod.verified; } hasSameEmailAs(email) { + if (this.email === undefined && email === undefined) { + return true; + } if (email === undefined) { return false; } @@ -28,6 +31,9 @@ class LoginMethod { return this.email !== undefined && this.email === email; } hasSamePhoneNumberAs(phoneNumber) { + if (this.phoneNumber === undefined && phoneNumber === undefined) { + return true; + } if (phoneNumber === undefined) { return false; } @@ -42,6 +48,9 @@ class LoginMethod { return this.phoneNumber !== undefined && this.phoneNumber === phoneNumber; } hasSameThirdPartyInfoAs(thirdParty) { + if (this.thirdParty === undefined && thirdParty === undefined) { + return true; + } if (thirdParty === undefined) { return false; } diff --git a/lib/ts/user.ts b/lib/ts/user.ts index 365e0f846..e4f10f342 100644 --- a/lib/ts/user.ts +++ b/lib/ts/user.ts @@ -29,6 +29,9 @@ export class LoginMethod implements RecipeLevelUser { } hasSameEmailAs(email: string | undefined): boolean { + if (this.email === undefined && email === undefined) { + return true; + } if (email === undefined) { return false; } @@ -38,6 +41,9 @@ export class LoginMethod implements RecipeLevelUser { } hasSamePhoneNumberAs(phoneNumber: string | undefined): boolean { + if (this.phoneNumber === undefined && phoneNumber === undefined) { + return true; + } if (phoneNumber === undefined) { return false; } @@ -53,6 +59,9 @@ export class LoginMethod implements RecipeLevelUser { } hasSameThirdPartyInfoAs(thirdParty?: { id: string; userId: string }): boolean { + if (this.thirdParty === undefined && thirdParty === undefined) { + return true; + } if (thirdParty === undefined) { return false; }