implement currentUser.toJSON() method

This commit is contained in:
Salakar 2017-03-13 20:01:45 +00:00
parent f9f075f43d
commit 7710dd94a7
1 changed files with 13 additions and 5 deletions

View File

@ -74,11 +74,7 @@ export default class User {
return this._valueOrNull('photoURL');
}
get photoUrl() {
return this._valueOrNull('photoURL');
}
// TODO no android method yet, the SDK does have .getProviderData but returns as a List.
// TODO no RN android method yet, the SDK does have .getProviderData but returns as a List.
// get providerData() {
// return this._valueOrNull('providerData');
// }
@ -101,6 +97,18 @@ export default class User {
* METHODS
*/
toJSON() {
return {
uid: this.uid,
email: this.email,
emailVerified: this.emailVerified,
displayName: this.displayName,
providerId: this.providerId,
isAnonymous: this.isAnonymous,
photoURL: this.photoURL,
};
}
delete(...args) {
return this._auth.deleteUser(...args);
}