Skip to content

Commit 5c99cb1

Browse files
committed
Rebase on base branch
1 parent dac6ffa commit 5c99cb1

File tree

5 files changed

+77
-19
lines changed

5 files changed

+77
-19
lines changed

packages/auth-interop-types/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# @firebase/auth-interop-types
2+
3+
**This package is not intended for direct usage, and should only be used via the officially supported [firebase](https://www.npmjs.com/package/firebase) package.**
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* @license
3+
* Copyright 2019 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
export interface FirebaseAuthTokenData {
19+
accessToken: string;
20+
}
21+
22+
export interface FirebaseAuthInternal {
23+
getToken(refreshToken?: boolean): Promise<FirebaseAuthTokenData | null>;
24+
getUid(): string | null;
25+
addAuthTokenListener(fn: (token: string | null) => void): void;
26+
removeAuthTokenListener(fn: (token: string | null) => void): void;
27+
}
28+
29+
export type FirebaseAuthInternalName = 'auth-internal';
30+
31+
declare module '@firebase/component' {
32+
interface NameServiceMapping {
33+
'auth-internal': FirebaseAuthInternal;
34+
}
35+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "@firebase/auth-interop-types",
3+
"version": "0.1.0",
4+
"description": "@firebase/auth interop Types",
5+
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
6+
"license": "Apache-2.0",
7+
"scripts": {
8+
"test": "tsc"
9+
},
10+
"files": [
11+
"index.d.ts"
12+
],
13+
"peerDependencies": {
14+
"@firebase/app-types": "0.x",
15+
"@firebase/util": "0.x"
16+
},
17+
"repository": {
18+
"directory": "packages/auth-types",
19+
"type": "git",
20+
"url": "https://github.com/firebase/firebase-js-sdk.git"
21+
},
22+
"bugs": {
23+
"url": "https://github.com/firebase/firebase-js-sdk/issues"
24+
},
25+
"devDependencies": {
26+
"typescript": "3.6.4"
27+
}
28+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "../../config/tsconfig.base.json",
3+
"compilerOptions": {
4+
"noEmit": true
5+
},
6+
"exclude": [
7+
"dist/**/*"
8+
]
9+
}

packages/auth/src/exports_auth.js

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -618,27 +618,10 @@ fireauth.exportlib.exportFunction(
618618

619619
(function() {
620620
if (typeof firebase === 'undefined' || !firebase.INTERNAL ||
621-
!firebase.INTERNAL.registerService) {
621+
!firebase.INTERNAL.registerComponent) {
622622
throw new Error('Cannot find the firebase namespace; be sure to include ' +
623623
'firebase-app.js before this library.');
624624
} else {
625-
/** @type {!firebase.ServiceFactory} */
626-
var factory = function(app, extendApp) {
627-
var auth = new fireauth.Auth(app);
628-
extendApp({
629-
'INTERNAL': {
630-
// Extend app.INTERNAL.getUid.
631-
'getUid': goog.bind(auth.getUid, auth),
632-
'getToken': goog.bind(auth.getIdTokenInternal, auth),
633-
'addAuthTokenListener':
634-
goog.bind(auth.addAuthTokenListenerInternal, auth),
635-
'removeAuthTokenListener':
636-
goog.bind(auth.removeAuthTokenListenerInternal, auth)
637-
}
638-
});
639-
return auth;
640-
};
641-
642625
var namespace = {
643626
// Exports firebase.auth.ActionCodeInfo.Operation.
644627
'ActionCodeInfo': {
@@ -728,4 +711,4 @@ fireauth.exportlib.exportFunction(
728711
'User': fireauth.AuthUser
729712
});
730713
}
731-
})();
714+
})();

0 commit comments

Comments
 (0)