@@ -53,8 +53,8 @@ export class UserMetadata implements IUserMetadata {
5353 toJSON ( ) {
5454 return {
5555 creationDate : this . creationDate ,
56- lastSignInDate : this . lastSignInDate
57- }
56+ lastSignInDate : this . lastSignInDate ,
57+ } ;
5858 }
5959}
6060
@@ -110,7 +110,7 @@ export class UserInfo implements IUserInfo {
110110 phoneNumber : this . phoneNumber ,
111111 providerId : this . providerId ,
112112 photoURL : this . photoURL ,
113- }
113+ } ;
114114 }
115115}
116116
@@ -190,8 +190,8 @@ export class User implements IUser {
190190 providerId : this . providerId ,
191191 photoURL : this . photoURL ,
192192 metadata : this . metadata ,
193- providerData : this . providerData
194- }
193+ providerData : this . providerData ,
194+ } ;
195195 }
196196
197197 delete ( ) : Promise < void > {
@@ -285,7 +285,7 @@ export class User implements IUser {
285285 } else {
286286 provider . _builder . getCredentialWithUIDelegateCompletion ( null , ( credential , error ) => {
287287 if ( error ) {
288- reject ( FirebaseError . fromNative ( error ) )
288+ reject ( FirebaseError . fromNative ( error ) ) ;
289289 } else {
290290 this . native . reauthenticateWithCredentialCompletion ( credential , ( result , error ) => {
291291 if ( error ) {
@@ -295,9 +295,9 @@ export class User implements IUser {
295295 }
296296 } ) ;
297297 }
298- } )
298+ } ) ;
299299 }
300- } )
300+ } ) ;
301301 }
302302
303303 reauthenticateWithCredential ( credential : AuthCredential ) : Promise < UserCredential > {
@@ -435,7 +435,7 @@ export class User implements IUser {
435435 if ( profile . photoUri ) {
436436 try {
437437 request . photoURL = NSURL . URLWithString ( profile . photoUri ) ;
438- } catch ( e ) { }
438+ } catch ( e ) { }
439439 }
440440
441441 request . commitChangesWithCompletion ( ( error ) => {
@@ -530,7 +530,7 @@ function toUserCredential(authData: FIRAuthDataResult): UserCredential {
530530 const result = {
531531 additionalUserInfo : null ,
532532 user : User . fromNative ( authData . user ) ,
533- credential : authData . credential instanceof FIROAuthCredential ? OAuthCredential . fromNative ( authData . credential ) : AuthCredential . fromNative ( authData . credential )
533+ credential : authData . credential instanceof FIROAuthCredential ? OAuthCredential . fromNative ( authData . credential ) : AuthCredential . fromNative ( authData . credential ) ,
534534 } ;
535535
536536 if ( authData ?. additionalUserInfo ) {
@@ -768,10 +768,9 @@ export class OAuthCredential extends AuthCredential implements IOAuthCredential
768768 }
769769}
770770
771-
772771export class OAuthProvider implements IOAuthProvider {
773772 #providerId: string ;
774- #customParameters: { [ key : string ] : string }
773+ #customParameters: { [ key : string ] : string } ;
775774 #scopes: string [ ] ;
776775 constructor ( providerId : string ) {
777776 this . #providerId = providerId ;
@@ -891,14 +890,8 @@ export class AuthTokenResult implements IAuthTokenResult {
891890
892891export class Auth implements IAuth {
893892 #native: FIRAuth ;
894-
895893 constructor ( app ?: FirebaseApp ) {
896- if ( app ?. native ) {
897- FIRAuth . auth ( ) ;
898- this . #native = FIRAuth . authWithApp ( app . native ) ;
899- } else {
900- this . #native = FIRAuth . authWithApp ( FIRApp . defaultApp ( ) ) ;
901- }
894+ this . #app = app ;
902895 }
903896
904897 useEmulator ( host : string , port : number ) {
@@ -1033,7 +1026,7 @@ export class Auth implements IAuth {
10331026 } else {
10341027 provider . _builder . getCredentialWithUIDelegateCompletion ( null , ( credential , error ) => {
10351028 if ( error ) {
1036- reject ( FirebaseError . fromNative ( error ) )
1029+ reject ( FirebaseError . fromNative ( error ) ) ;
10371030 } else {
10381031 this . native . signInWithCredentialCompletion ( credential , ( result , error ) => {
10391032 if ( error ) {
@@ -1043,9 +1036,9 @@ export class Auth implements IAuth {
10431036 }
10441037 } ) ;
10451038 }
1046- } )
1039+ } ) ;
10471040 }
1048- } )
1041+ } ) ;
10491042 }
10501043
10511044 signInWithCredential ( credential : AuthCredential ) : Promise < UserCredential > {
@@ -1231,6 +1224,13 @@ export class Auth implements IAuth {
12311224 }
12321225
12331226 get native ( ) {
1227+ if ( ! this . #native) {
1228+ if ( this . #app?. native ) {
1229+ this . #native = FIRAuth . authWithApp ( this . #app. native ) ;
1230+ } else {
1231+ this . #native = FIRAuth . auth ( ) ;
1232+ }
1233+ }
12341234 return this . #native;
12351235 }
12361236
0 commit comments