@@ -41,8 +41,7 @@ export type AuthTokenFactory = () => string;
41
41
42
42
export interface FirstPartyCredentialsSettings {
43
43
// These are external types. Prevent minification.
44
- [ 'type' ] : 'gapi' ;
45
- [ 'client' ] : unknown ;
44
+ [ 'type' ] : 'firstParty' ;
46
45
[ 'sessionIndex' ] : string ;
47
46
[ 'iamToken' ] : string | null ;
48
47
[ 'authTokenFactory' ] : AuthTokenFactory | null ;
@@ -379,15 +378,6 @@ export class FirebaseAuthCredentialsProvider
379
378
}
380
379
}
381
380
382
- // Manual type definition for the subset of Gapi we use.
383
- interface Gapi {
384
- auth : {
385
- getAuthHeaderValueForFirstParty : (
386
- userIdentifiers : Array < { [ key : string ] : string } >
387
- ) => string | null ;
388
- } ;
389
- }
390
-
391
381
/*
392
382
* FirstPartyToken provides a fresh token each time its value
393
383
* is requested, because if the token is too old, requests will be rejected.
@@ -401,7 +391,6 @@ export class FirstPartyToken implements Token {
401
391
private _headers = new Map ( ) ;
402
392
403
393
constructor (
404
- private readonly gapi : Gapi | null ,
405
394
private readonly sessionIndex : string ,
406
395
private readonly iamToken : string | null ,
407
396
private readonly authTokenFactory : AuthTokenFactory | null
@@ -443,7 +432,6 @@ export class FirstPartyAuthCredentialsProvider
443
432
implements CredentialsProvider < User >
444
433
{
445
434
constructor (
446
- private gapi : Gapi | null ,
447
435
private sessionIndex : string ,
448
436
private iamToken : string | null ,
449
437
private authTokenFactory : AuthTokenFactory | null
@@ -452,7 +440,6 @@ export class FirstPartyAuthCredentialsProvider
452
440
getToken ( ) : Promise < Token | null > {
453
441
return Promise . resolve (
454
442
new FirstPartyToken (
455
- this . gapi ,
456
443
this . sessionIndex ,
457
444
this . iamToken ,
458
445
this . authTokenFactory
@@ -661,12 +648,9 @@ export function makeAuthCredentialsProvider(
661
648
if ( ! credentials ) {
662
649
return new EmptyAuthCredentialsProvider ( ) ;
663
650
}
664
-
665
651
switch ( credentials [ 'type' ] ) {
666
- case 'gapi' :
667
- const client = credentials [ 'client' ] as Gapi ;
652
+ case 'firstParty' :
668
653
return new FirstPartyAuthCredentialsProvider (
669
- client ,
670
654
credentials [ 'sessionIndex' ] || '0' ,
671
655
credentials [ 'iamToken' ] || null ,
672
656
credentials [ 'authTokenFactory' ] || null
0 commit comments