File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed
packages/installations/src Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ import { ERROR_FACTORY, ErrorCode } from '../util/errors';
3232export async function getId ( installations : Installations ) : Promise < string > {
3333 if ( _isFirebaseServerApp ( installations . app ) ) {
3434 if ( ! installations . app . installationsId ) {
35- throw ERROR_FACTORY . create ( ErrorCode . SERVER_APP_MISSING_AUTH_TOKEN ) ;
35+ throw ERROR_FACTORY . create (
36+ ErrorCode . SERVER_APP_MISSING_INSTALLATIONS_AUTH_TOKEN
37+ ) ;
3638 }
3739 return installations . app . installationsId ;
3840 }
Original file line number Diff line number Diff line change @@ -35,8 +35,10 @@ export async function getToken(
3535 forceRefresh = false
3636) : Promise < string > {
3737 if ( _isFirebaseServerApp ( installations . app ) ) {
38- if ( installations . app . installationsAuthToken === undefined ) {
39- throw ERROR_FACTORY . create ( ErrorCode . SERVER_APP_MISSING_AUTH_TOKEN ) ;
38+ if ( ! installations . app . installationsAuthToken ) {
39+ throw ERROR_FACTORY . create (
40+ ErrorCode . SERVER_APP_MISSING_INSTALLATIONS_AUTH_TOKEN
41+ ) ;
4042 }
4143 return installations . app . installationsAuthToken ;
4244 }
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ export const enum ErrorCode {
2525 REQUEST_FAILED = 'request-failed' ,
2626 APP_OFFLINE = 'app-offline' ,
2727 DELETE_PENDING_REGISTRATION = 'delete-pending-registration' ,
28- SERVER_APP_MISSING_AUTH_TOKEN = 'server-app-missing-auth-token'
28+ SERVER_APP_MISSING_INSTALLATIONS_AUTH_TOKEN = 'server-app-missing-installatoins -auth-token'
2929}
3030
3131const ERROR_DESCRIPTION_MAP : { readonly [ key in ErrorCode ] : string } = {
@@ -38,7 +38,7 @@ const ERROR_DESCRIPTION_MAP: { readonly [key in ErrorCode]: string } = {
3838 [ ErrorCode . APP_OFFLINE ] : 'Could not process request. Application offline.' ,
3939 [ ErrorCode . DELETE_PENDING_REGISTRATION ] :
4040 "Can't delete installation while there is a pending registration request." ,
41- [ ErrorCode . SERVER_APP_MISSING_AUTH_TOKEN ] :
41+ [ ErrorCode . SERVER_APP_MISSING_INSTALLATIONS_AUTH_TOKEN ] :
4242 'The instance of FirebaseServerApp was not initialized with a valid installationsAuthToken'
4343} ;
4444
You can’t perform that action at this time.
0 commit comments