Skip to content

Commit 68e90dc

Browse files
Merge
2 parents e59a319 + 6555aa7 commit 68e90dc

File tree

79 files changed

+1024
-349
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1024
-349
lines changed

.changeset/curvy-brooms-clean.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@firebase/auth": patch
3+
---
4+
5+
Fix bug where `user.providerData` field was being improperly initialized

.changeset/gold-geckos-carry.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

common/api-review/auth.api.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,11 @@ export class PhoneMultiFactorGenerator {
601601
static FACTOR_ID: string;
602602
}
603603

604+
// @public
605+
export interface PhoneMultiFactorInfo extends MultiFactorInfo {
606+
readonly phoneNumber: string;
607+
}
608+
604609
// @public
605610
export interface PhoneMultiFactorSignInInfoOptions {
606611
multiFactorHint?: MultiFactorInfo;

integration/compat-interop/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
"test:debug": "karma start --browsers Chrome --auto-watch"
99
},
1010
"dependencies": {
11-
"@firebase/app": "0.7.14",
12-
"@firebase/app-compat": "0.1.15",
11+
"@firebase/app": "0.7.15",
12+
"@firebase/app-compat": "0.1.16",
1313
"@firebase/analytics": "0.7.5",
1414
"@firebase/analytics-compat": "0.1.6",
15-
"@firebase/auth": "0.19.6",
16-
"@firebase/auth-compat": "0.2.6",
17-
"@firebase/functions": "0.7.7",
18-
"@firebase/functions-compat": "0.1.8",
15+
"@firebase/auth": "0.19.7",
16+
"@firebase/auth-compat": "0.2.7",
17+
"@firebase/functions": "0.7.8",
18+
"@firebase/functions-compat": "0.1.9",
1919
"@firebase/messaging": "0.9.7",
2020
"@firebase/messaging-compat": "0.1.7",
2121
"@firebase/performance": "0.5.5",

integration/firebase/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test"
88
},
99
"devDependencies": {
10-
"firebase": "9.6.4",
10+
"firebase": "9.6.5",
1111
"@types/chai": "4.2.22",
1212
"@types/mocha": "9.0.0",
1313
"chai": "4.3.4",

integration/firestore/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"test:memory:debug": "yarn build:memory; karma start --auto-watch --browsers Chrome"
1616
},
1717
"dependencies": {
18-
"@firebase/app": "0.7.14",
19-
"@firebase/firestore": "3.4.3"
18+
"@firebase/app": "0.7.15",
19+
"@firebase/firestore": "3.4.4"
2020
},
2121
"devDependencies": {
2222
"@types/mocha": "9.0.0",

integration/messaging/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
"test:manual": "mocha --exit"
1010
},
1111
"devDependencies": {
12-
"firebase": "9.6.4",
12+
"firebase": "9.6.5",
1313
"chai": "4.3.4",
1414
"chromedriver": "94.0.0",
1515
"express": "4.17.1",
1616
"geckodriver": "2.0.4",
1717
"mocha": "9.1.1",
18-
"node-fetch": "2.6.5",
18+
"node-fetch": "2.6.7",
1919
"selenium-assistant": "6.1.0"
2020
}
2121
}

packages/analytics-compat/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@firebase/app-compat": "0.x"
2424
},
2525
"devDependencies": {
26-
"@firebase/app-compat": "0.1.15",
26+
"@firebase/app-compat": "0.1.16",
2727
"rollup": "2.57.0",
2828
"@rollup/plugin-json": "4.1.0",
2929
"rollup-plugin-typescript2": "0.30.0",

packages/analytics/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
},
4848
"license": "Apache-2.0",
4949
"devDependencies": {
50-
"@firebase/app": "0.7.14",
50+
"@firebase/app": "0.7.15",
5151
"rollup": "2.57.0",
5252
"@rollup/plugin-commonjs": "21.0.0",
5353
"@rollup/plugin-json": "4.1.0",

packages/app-check-compat/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
},
4343
"license": "Apache-2.0",
4444
"devDependencies": {
45-
"@firebase/app-compat": "0.1.15",
45+
"@firebase/app-compat": "0.1.16",
4646
"rollup": "2.57.0",
4747
"@rollup/plugin-commonjs": "21.0.0",
4848
"@rollup/plugin-json": "4.1.0",

packages/app-check/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
},
4545
"license": "Apache-2.0",
4646
"devDependencies": {
47-
"@firebase/app": "0.7.14",
47+
"@firebase/app": "0.7.15",
4848
"rollup": "2.57.0",
4949
"@rollup/plugin-commonjs": "21.0.0",
5050
"@rollup/plugin-json": "4.1.0",

packages/app-compat/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @firebase/app-compat
22

3+
## 0.1.16
4+
5+
### Patch Changes
6+
7+
- Updated dependencies []:
8+
- @firebase/app@0.7.15
9+
310
## 0.1.15
411

512
### Patch Changes

packages/app-compat/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@firebase/app-compat",
3-
"version": "0.1.15",
3+
"version": "0.1.16",
44
"description": "The primary entrypoint to the Firebase JS SDK",
55
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
66
"main": "dist/index.cjs.js",
@@ -39,7 +39,7 @@
3939
},
4040
"license": "Apache-2.0",
4141
"dependencies": {
42-
"@firebase/app": "0.7.14",
42+
"@firebase/app": "0.7.15",
4343
"@firebase/util": "1.4.3",
4444
"@firebase/logger": "0.3.2",
4545
"@firebase/component": "0.5.10",

packages/app/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @firebase/app
22

3+
## 0.7.15
4+
5+
### Patch Changes
6+
7+
- Update SDK_VERSION.
8+
39
## 0.7.14
410

511
### Patch Changes

packages/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@firebase/app",
3-
"version": "0.7.14",
3+
"version": "0.7.15",
44
"description": "The primary entrypoint to the Firebase JS SDK",
55
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
66
"main": "dist/index.cjs.js",

packages/auth-compat/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# @firebase/auth-compat
22

3+
## 0.2.7
4+
5+
### Patch Changes
6+
7+
- [`4983f4d5a`](https://github.com/firebase/firebase-js-sdk/commit/4983f4d5a0dc385c5b3e042ace44c8204d3cce81) [#5923](https://github.com/firebase/firebase-js-sdk/pull/5923) - Fix errors in compatibility layer when cookies are fully disabled in Chrome
8+
9+
* [`d612d6f6e`](https://github.com/firebase/firebase-js-sdk/commit/d612d6f6e4d3113d45427b7df68459c0a3e31a1f) [#5928](https://github.com/firebase/firebase-js-sdk/pull/5928) - Upgrade `node-fetch` dependency due to a security issue.
10+
11+
* Updated dependencies [[`4983f4d5a`](https://github.com/firebase/firebase-js-sdk/commit/4983f4d5a0dc385c5b3e042ace44c8204d3cce81), [`d612d6f6e`](https://github.com/firebase/firebase-js-sdk/commit/d612d6f6e4d3113d45427b7df68459c0a3e31a1f), [`e04b7452b`](https://github.com/firebase/firebase-js-sdk/commit/e04b7452bae10e6525cfb9c551f76a1aa98f9078), [`2820674b8`](https://github.com/firebase/firebase-js-sdk/commit/2820674b848e918ab164e7d0ec9d5b838bbfa6e0)]:
12+
- @firebase/auth@0.19.7
13+
314
## 0.2.6
415

516
### Patch Changes

packages/auth-compat/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@firebase/auth-compat",
3-
"version": "0.2.6",
3+
"version": "0.2.7",
44
"description": "FirebaseAuth compatibility package that uses API style compatible with Firebase@8 and prior versions",
55
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
66
"main": "dist/index.node.cjs.js",
@@ -43,17 +43,17 @@
4343
"@firebase/app-compat": "0.x"
4444
},
4545
"dependencies": {
46-
"@firebase/auth": "0.19.6",
46+
"@firebase/auth": "0.19.7",
4747
"@firebase/auth-types": "0.11.0",
4848
"@firebase/component": "0.5.10",
4949
"@firebase/util": "1.4.3",
50-
"node-fetch": "2.6.5",
50+
"node-fetch": "2.6.7",
5151
"selenium-webdriver": "^4.0.0-beta.2",
5252
"tslib": "^2.1.0"
5353
},
5454
"license": "Apache-2.0",
5555
"devDependencies": {
56-
"@firebase/app-compat": "0.1.15",
56+
"@firebase/app-compat": "0.1.16",
5757
"@rollup/plugin-json": "4.1.0",
5858
"rollup": "2.57.0",
5959
"rollup-plugin-replace": "2.2.0",

packages/auth/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# @firebase/auth
22

3+
## 0.19.7
4+
5+
### Patch Changes
6+
7+
- [`4983f4d5a`](https://github.com/firebase/firebase-js-sdk/commit/4983f4d5a0dc385c5b3e042ace44c8204d3cce81) [#5923](https://github.com/firebase/firebase-js-sdk/pull/5923) - Fix errors in compatibility layer when cookies are fully disabled in Chrome
8+
9+
* [`d612d6f6e`](https://github.com/firebase/firebase-js-sdk/commit/d612d6f6e4d3113d45427b7df68459c0a3e31a1f) [#5928](https://github.com/firebase/firebase-js-sdk/pull/5928) - Upgrade `node-fetch` dependency due to a security issue.
10+
11+
- [`e04b7452b`](https://github.com/firebase/firebase-js-sdk/commit/e04b7452bae10e6525cfb9c551f76a1aa98f9078) [#5924](https://github.com/firebase/firebase-js-sdk/pull/5924) (fixes [#5922](https://github.com/firebase/firebase-js-sdk/issues/5922)) - Add missing PhoneMultiFactorInfo public interface
12+
13+
* [`2820674b8`](https://github.com/firebase/firebase-js-sdk/commit/2820674b848e918ab164e7d0ec9d5b838bbfa6e0) [#5927](https://github.com/firebase/firebase-js-sdk/pull/5927) - Prevent React Native from logging a warning about deprecation of `AsyncStorage` if the developer has provided the non-deprecated version.
14+
315
## 0.19.6
416

517
### Patch Changes

packages/auth/index.rn.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* just use index.ts
2323
*/
2424

25-
import { AsyncStorage } from 'react-native';
25+
import * as ReactNative from 'react-native';
2626

2727
import { FirebaseApp, getApp, _getProvider } from '@firebase/app';
2828
import { Auth, Persistence } from './src/model/public_types';
@@ -57,7 +57,20 @@ export { PhoneMultiFactorGenerator } from './src/platform_browser/mfa/assertions
5757
* @public
5858
*/
5959
export const reactNativeLocalPersistence: Persistence =
60-
getReactNativePersistence(AsyncStorage);
60+
getReactNativePersistence({
61+
getItem(...args) {
62+
// Called inline to avoid deprecation warnings on startup.
63+
return ReactNative.AsyncStorage.getItem(...args);
64+
},
65+
setItem(...args) {
66+
// Called inline to avoid deprecation warnings on startup.
67+
return ReactNative.AsyncStorage.setItem(...args);
68+
},
69+
removeItem(...args) {
70+
// Called inline to avoid deprecation warnings on startup.
71+
return ReactNative.AsyncStorage.removeItem(...args);
72+
},
73+
});
6174

6275
export {getReactNativePersistence};
6376

packages/auth/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@firebase/auth",
3-
"version": "0.19.6",
3+
"version": "0.19.7",
44
"description": "The Firebase Authenticaton component of the Firebase JS SDK.",
55
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
66
"main": "dist/node/index.js",
@@ -80,13 +80,13 @@
8080
"@firebase/component": "0.5.10",
8181
"@firebase/logger": "0.3.2",
8282
"@firebase/util": "1.4.3",
83-
"node-fetch": "2.6.5",
83+
"node-fetch": "2.6.7",
8484
"selenium-webdriver": "4.0.0-rc-1",
8585
"tslib": "^2.1.0"
8686
},
8787
"license": "Apache-2.0",
8888
"devDependencies": {
89-
"@firebase/app": "0.7.14",
89+
"@firebase/app": "0.7.15",
9090
"@rollup/plugin-json": "4.1.0",
9191
"@rollup/plugin-strip": "2.1.0",
9292
"chromedriver": "96.0.0",

packages/auth/src/core/user/user_impl.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,14 @@ describe('core/user/user_impl', () => {
264264
photoURL: 'photo',
265265
emailVerified: false,
266266
isAnonymous: true,
267+
providerData: [{
268+
providerId: 'password',
269+
displayName: null,
270+
photoURL: null,
271+
272+
phoneNumber: null,
273+
uid: 'i-am-uid'
274+
}],
267275
tenantId: 'tenant-id'
268276
});
269277

@@ -274,6 +282,14 @@ describe('core/user/user_impl', () => {
274282
expect(copy.toJSON()).to.eql(user.toJSON());
275283
expect(copy.auth).to.eq(newAuth);
276284
expect(copy.tenantId).to.eq('tenant-id');
285+
expect(copy.providerData).to.eql([{
286+
providerId: 'password',
287+
displayName: null,
288+
photoURL: null,
289+
290+
phoneNumber: null,
291+
uid: 'i-am-uid'
292+
}]);
277293
});
278294
});
279295
});

packages/auth/src/core/user/user_impl.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ export class UserImpl implements UserInternal {
6161

6262
uid: string;
6363
auth: AuthInternal;
64-
emailVerified = false;
65-
isAnonymous = false;
66-
tenantId: string | null = null;
64+
emailVerified: boolean;
65+
isAnonymous: boolean;
66+
tenantId: string | null;
6767
readonly metadata: UserMetadata;
68-
providerData: MutableUserInfo[] = [];
68+
providerData: MutableUserInfo[];
6969

7070
// Optional fields from UserInfo
7171
displayName: string | null;
@@ -88,6 +88,7 @@ export class UserImpl implements UserInternal {
8888
this.photoURL = opt.photoURL || null;
8989
this.isAnonymous = opt.isAnonymous || false;
9090
this.tenantId = opt.tenantId || null;
91+
this.providerData = opt.providerData ? [...opt.providerData] : [];
9192
this.metadata = new UserMetadata(
9293
opt.createdAt || undefined,
9394
opt.lastLoginAt || undefined

packages/auth/src/mfa/mfa_info.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
import { FactorId, MultiFactorInfo } from '../model/public_types';
18+
import { FactorId, MultiFactorInfo, PhoneMultiFactorInfo } from '../model/public_types';
1919
import {
2020
PhoneMfaEnrollment,
2121
MfaEnrollment
@@ -40,13 +40,13 @@ export abstract class MultiFactorInfoImpl implements MultiFactorInfo {
4040
enrollment: MfaEnrollment
4141
): MultiFactorInfoImpl {
4242
if ('phoneInfo' in enrollment) {
43-
return PhoneMultiFactorInfo._fromServerResponse(auth, enrollment);
43+
return PhoneMultiFactorInfoImpl._fromServerResponse(auth, enrollment);
4444
}
4545
return _fail(auth, AuthErrorCode.INTERNAL_ERROR);
4646
}
4747
}
4848

49-
export class PhoneMultiFactorInfo extends MultiFactorInfoImpl {
49+
export class PhoneMultiFactorInfoImpl extends MultiFactorInfoImpl implements PhoneMultiFactorInfo {
5050
readonly phoneNumber: string;
5151

5252
private constructor(response: PhoneMfaEnrollment) {
@@ -57,7 +57,7 @@ export class PhoneMultiFactorInfo extends MultiFactorInfoImpl {
5757
static _fromServerResponse(
5858
_auth: AuthInternal,
5959
enrollment: MfaEnrollment
60-
): PhoneMultiFactorInfo {
61-
return new PhoneMultiFactorInfo(enrollment);
60+
): PhoneMultiFactorInfoImpl {
61+
return new PhoneMultiFactorInfoImpl(enrollment);
6262
}
6363
}

packages/auth/src/model/public_types.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,15 @@ export interface MultiFactorInfo {
628628
readonly factorId: typeof FactorIdMap[keyof typeof FactorIdMap];
629629
}
630630

631+
/**
632+
* The subclass of the {@link MultiFactorInfo} interface for phone number
633+
* second factors. The factorId of this second factor is {@link FactorId.PHONE}.
634+
*/
635+
export interface PhoneMultiFactorInfo extends MultiFactorInfo {
636+
/** The phone number associated with the current second factor. */
637+
readonly phoneNumber: string;
638+
}
639+
631640
/**
632641
* The class used to facilitate recovery from {@link MultiFactorError} when a user needs to
633642
* provide a second factor to sign in.

packages/auth/src/model/user.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export interface UserParameters {
4242
isAnonymous?: boolean | null;
4343
emailVerified?: boolean | null;
4444
tenantId?: string | null;
45+
providerData?: MutableUserInfo[] | null;
4546

4647
createdAt?: string | null;
4748
lastLoginAt?: string | null;

0 commit comments

Comments
 (0)