diff --git a/packages/database/src/core/AppCheckTokenProvider.ts b/packages/database/src/core/AppCheckTokenProvider.ts index ce9ce5575f6..612cb902e5f 100644 --- a/packages/database/src/core/AppCheckTokenProvider.ts +++ b/packages/database/src/core/AppCheckTokenProvider.ts @@ -50,15 +50,9 @@ export class AppCheckTokenProvider { getToken(forceRefresh?: boolean): Promise { if (this.serverAppAppCheckToken) { if (forceRefresh) { - return new Promise(resolve => { - const appCheckTokenResult = { - token: 'ERROR', - error: new Error( - 'Attempted reuse of FirebaseServerApp.appCheckToken after previous usage failed.' - ) - }; - resolve(appCheckTokenResult); - }); + throw new Error( + 'Attempted reuse of `FirebaseServerApp.appCheckToken` after previous usage failed.' + ); } return Promise.resolve({ token: this.serverAppAppCheckToken }); }