Skip to content

Commit c6fc558

Browse files
committed
remove redundant storage of installationsAuthId
1 parent 41382ed commit c6fc558

File tree

4 files changed

+6
-15
lines changed

4 files changed

+6
-15
lines changed

common/api-review/app.api.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ export interface FirebaseOptions {
7373

7474
// @public
7575
export interface FirebaseServerApp extends FirebaseApp {
76-
// (undocumented)
77-
readonly installationsAuthToken: string | null;
78-
// (undocumented)
7976
readonly installationsId: string | null;
8077
name: string;
8178
readonly settings: FirebaseServerAppSettings;

packages/app/src/firebaseServerApp.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,6 @@ export class FirebaseServerAppImpl
144144
return this._serverConfig;
145145
}
146146

147-
get installationsAuthToken(): string | null {
148-
this.checkDestroyed();
149-
if (this._serverConfig.installationsAuthToken !== undefined) {
150-
return this._serverConfig.installationsAuthToken;
151-
} else {
152-
return null;
153-
}
154-
}
155-
156147
get installationsId(): string | null {
157148
this.checkDestroyed();
158149
return this._installationsId;

packages/app/src/public-types.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,11 @@ export interface FirebaseServerApp extends FirebaseApp {
101101
*/
102102
readonly settings: FirebaseServerAppSettings;
103103

104+
/**
105+
* The parsed Firebase Installations Id token if a `installationsAuthToken` was provided to
106+
* {@link (initializeServerApp:1) | initializeServerApp()}. Null otherwise.
107+
*/
104108
readonly installationsId: string | null;
105-
readonly installationsAuthToken: string | null;
106109
}
107110

108111
/**

packages/installations/src/api/get-token.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ export async function getToken(
3535
forceRefresh = false
3636
): Promise<string> {
3737
if (_isFirebaseServerApp(installations.app)) {
38-
if (!installations.app.installationsAuthToken) {
38+
if (!installations.app.settings.installationsAuthToken) {
3939
throw ERROR_FACTORY.create(
4040
ErrorCode.SERVER_APP_MISSING_INSTALLATIONS_AUTH_TOKEN
4141
);
4242
}
43-
return installations.app.installationsAuthToken;
43+
return installations.app.settings.installationsAuthToken;
4444
}
4545
const installationsImpl = installations as FirebaseInstallationsImpl;
4646
await completeInstallationRegistration(installationsImpl);

0 commit comments

Comments
 (0)