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';
32
32
export async function getId ( installations : Installations ) : Promise < string > {
33
33
if ( _isFirebaseServerApp ( installations . app ) ) {
34
34
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
+ ) ;
36
38
}
37
39
return installations . app . installationsId ;
38
40
}
Original file line number Diff line number Diff line change @@ -35,8 +35,10 @@ export async function getToken(
35
35
forceRefresh = false
36
36
) : Promise < string > {
37
37
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
+ ) ;
40
42
}
41
43
return installations . app . installationsAuthToken ;
42
44
}
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ export const enum ErrorCode {
25
25
REQUEST_FAILED = 'request-failed' ,
26
26
APP_OFFLINE = 'app-offline' ,
27
27
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'
29
29
}
30
30
31
31
const ERROR_DESCRIPTION_MAP : { readonly [ key in ErrorCode ] : string } = {
@@ -38,7 +38,7 @@ const ERROR_DESCRIPTION_MAP: { readonly [key in ErrorCode]: string } = {
38
38
[ ErrorCode . APP_OFFLINE ] : 'Could not process request. Application offline.' ,
39
39
[ ErrorCode . DELETE_PENDING_REGISTRATION ] :
40
40
"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 ] :
42
42
'The instance of FirebaseServerApp was not initialized with a valid installationsAuthToken'
43
43
} ;
44
44
You can’t perform that action at this time.
0 commit comments