@@ -73,6 +73,13 @@ export class UserMetadata implements IUserMetadata {
73
73
}
74
74
return null ;
75
75
}
76
+
77
+ toJSON ( ) {
78
+ return {
79
+ creationDate : this . creationDate ,
80
+ lastSignInDate : this . lastSignInDate
81
+ }
82
+ }
76
83
}
77
84
78
85
export class UserInfo implements IUserInfo {
@@ -82,6 +89,7 @@ export class UserInfo implements IUserInfo {
82
89
if ( info ) {
83
90
const nativeInfo = new UserInfo ( ) ;
84
91
nativeInfo . #native = info ;
92
+ return nativeInfo ;
85
93
}
86
94
return null ;
87
95
}
@@ -122,6 +130,17 @@ export class UserInfo implements IUserInfo {
122
130
get providerId ( ) : string {
123
131
return this . native ?. getProviderId ?.( ) ;
124
132
}
133
+
134
+ toJSON ( ) {
135
+ return {
136
+ displayName : this . displayName ,
137
+ email : this . email ,
138
+ uid : this . uid ,
139
+ phoneNumber : this . phoneNumber ,
140
+ providerId : this . providerId ,
141
+ photoURL : this . photoURL ,
142
+ }
143
+ }
125
144
}
126
145
127
146
export class User implements IUser {
@@ -194,6 +213,21 @@ export class User implements IUser {
194
213
return data ;
195
214
}
196
215
216
+ toJSON ( ) {
217
+ return {
218
+ displayName : this . displayName ,
219
+ anonymous : this . anonymous ,
220
+ emailVerified : this . emailVerified ,
221
+ email : this . email ,
222
+ uid : this . uid ,
223
+ phoneNumber : this . phoneNumber ,
224
+ providerId : this . providerId ,
225
+ photoURL : this . photoURL ,
226
+ metadata : this . metadata ,
227
+ providerData : this . providerData
228
+ }
229
+ }
230
+
197
231
delete ( ) : Promise < void > {
198
232
return new Promise ( ( resolve , reject ) => {
199
233
if ( ! this . native ) {
@@ -741,9 +775,9 @@ export class PhoneAuthProvider {
741
775
ensureClass ( ) ;
742
776
const cb = new OnVerificationStateChangedCallbacks ( resolve , reject ) ;
743
777
com . google . firebase . auth . PhoneAuthProvider
744
- . verifyPhoneNumber ( this . native . setPhoneNumber ( phoneNumber )
745
- . setCallbacks ( cb )
746
- . build ( ) ) ;
778
+ . verifyPhoneNumber ( this . native . setPhoneNumber ( phoneNumber )
779
+ . setCallbacks ( cb )
780
+ . build ( ) ) ;
747
781
}
748
782
} ) ;
749
783
}
@@ -806,8 +840,6 @@ export class OAuthCredential extends AuthCredential implements IOAuthCredential
806
840
}
807
841
}
808
842
809
-
810
-
811
843
export class OAuthProvider implements IOAuthProvider {
812
844
#providerId: string ;
813
845
#customProvider: boolean ;
0 commit comments