@@ -417,11 +417,12 @@ export abstract class BaseAuth {
417
417
* @returns A promise fulfilled with the user
418
418
* data corresponding to the newly created user.
419
419
*/
420
- public createUser ( properties : CreateRequest ) : Promise < UserRecord > {
420
+ public createUser ( properties : CreateRequest , noFetchUserRecord : boolean = false ) : Promise < UserRecord | null > {
421
421
return this . authRequestHandler . createNewAccount ( properties )
422
422
. then ( ( uid ) => {
423
423
// Return the corresponding user record.
424
- return this . getUser ( uid ) ;
424
+ if ( noFetchUserRecord ) return this . getUser ( uid ) ;
425
+ return null
425
426
} )
426
427
. catch ( ( error ) => {
427
428
if ( error . code === 'auth/user-not-found' ) {
@@ -531,7 +532,7 @@ export abstract class BaseAuth {
531
532
* @returns A promise fulfilled with the
532
533
* updated user data.
533
534
*/
534
- public updateUser ( uid : string , properties : UpdateRequest ) : Promise < UserRecord > {
535
+ public updateUser ( uid : string , properties : UpdateRequest , noFetchUserRecord : boolean = false ) : Promise < UserRecord | null > {
535
536
// Although we don't really advertise it, we want to also handle linking of
536
537
// non-federated idps with this call. So if we detect one of them, we'll
537
538
// adjust the properties parameter appropriately. This *does* imply that a
@@ -579,7 +580,9 @@ export abstract class BaseAuth {
579
580
return this . authRequestHandler . updateExistingAccount ( uid , properties )
580
581
. then ( ( existingUid ) => {
581
582
// Return the corresponding user record.
583
+ if ( noFetchUserRecord )
582
584
return this . getUser ( existingUid ) ;
585
+ return null
583
586
} ) ;
584
587
}
585
588
0 commit comments