From 74c20db233891c80ce8a60db0e818a798dffc68b Mon Sep 17 00:00:00 2001 From: Robin Genz Date: Tue, 19 Sep 2023 15:01:47 +0200 Subject: [PATCH 1/6] feat(authentication): expose `providerData` property --- .changeset/happy-cows-own.md | 5 ++ packages/authentication/README.md | 35 +++++++++---- .../FirebaseAuthenticationHelper.java | 22 ++++++++ .../Plugin/FirebaseAuthenticationHelper.swift | 16 ++++++ packages/authentication/src/definitions.ts | 50 +++++++++++++++++++ packages/authentication/src/web.ts | 16 ++++++ 6 files changed, 133 insertions(+), 11 deletions(-) create mode 100644 .changeset/happy-cows-own.md diff --git a/.changeset/happy-cows-own.md b/.changeset/happy-cows-own.md new file mode 100644 index 00000000..35a839b6 --- /dev/null +++ b/.changeset/happy-cows-own.md @@ -0,0 +1,5 @@ +--- +'@capacitor-firebase/authentication': minor +--- + +feat: expose `providerData` property diff --git a/packages/authentication/README.md b/packages/authentication/README.md index 8905da7b..e6ff115a 100644 --- a/packages/authentication/README.md +++ b/packages/authentication/README.md @@ -1513,17 +1513,30 @@ Remove all listeners for this plugin. #### User -| Prop | Type | Since | -| ------------------- | --------------------------- | ----- | -| **`displayName`** | string \| null | 0.1.0 | -| **`email`** | string \| null | 0.1.0 | -| **`emailVerified`** | boolean | 0.1.0 | -| **`isAnonymous`** | boolean | 0.1.0 | -| **`phoneNumber`** | string \| null | 0.1.0 | -| **`photoUrl`** | string \| null | 0.1.0 | -| **`providerId`** | string | 0.1.0 | -| **`tenantId`** | string \| null | 0.1.0 | -| **`uid`** | string | 0.1.0 | +| Prop | Type | Description | Since | +| ------------------- | --------------------------- | -------------------------------------------------------------------- | ----- | +| **`displayName`** | string \| null | | 0.1.0 | +| **`email`** | string \| null | | 0.1.0 | +| **`emailVerified`** | boolean | | 0.1.0 | +| **`isAnonymous`** | boolean | | 0.1.0 | +| **`phoneNumber`** | string \| null | | 0.1.0 | +| **`photoUrl`** | string \| null | | 0.1.0 | +| **`providerData`** | UserInfo[] | Additional per provider such as displayName and profile information. | 5.2.0 | +| **`providerId`** | string | | 0.1.0 | +| **`tenantId`** | string \| null | | 0.1.0 | +| **`uid`** | string | | 0.1.0 | + + +#### UserInfo + +| Prop | Type | Description | Since | +| ----------------- | --------------------------- | ----------------------------------------------------------------------------------------- | ----- | +| **`displayName`** | string \| null | The display name of the user. | 5.2.0 | +| **`email`** | string \| null | The email of the user. | 5.2.0 | +| **`phoneNumber`** | string \| null | The phone number normalized based on the E.164 standard (e.g. +16505550101) for the user. | 5.2.0 | +| **`photoUrl`** | string \| null | The profile photo URL of the user. | 5.2.0 | +| **`providerId`** | string | The provider used to authenticate the user. | 5.2.0 | +| **`uid`** | string | The user's unique ID. | 5.2.0 | #### AuthCredential diff --git a/packages/authentication/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/authentication/FirebaseAuthenticationHelper.java b/packages/authentication/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/authentication/FirebaseAuthenticationHelper.java index 43b4f9ec..93880a11 100644 --- a/packages/authentication/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/authentication/FirebaseAuthenticationHelper.java +++ b/packages/authentication/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/authentication/FirebaseAuthenticationHelper.java @@ -1,12 +1,18 @@ package io.capawesome.capacitorjs.plugins.firebase.authentication; import androidx.annotation.Nullable; +import com.getcapacitor.JSArray; import com.getcapacitor.JSObject; import com.google.firebase.auth.AdditionalUserInfo; import com.google.firebase.auth.AuthCredential; import com.google.firebase.auth.FirebaseAuthException; import com.google.firebase.auth.FirebaseUser; import com.google.firebase.auth.OAuthCredential; +import com.google.firebase.auth.UserInfo; + +import org.json.JSONObject; + +import java.util.List; import java.util.Map; public class FirebaseAuthenticationHelper { @@ -67,6 +73,7 @@ public static JSObject createUserResult(@Nullable FirebaseUser user) { result.put("isAnonymous", user.isAnonymous()); result.put("phoneNumber", user.getPhoneNumber()); result.put("photoUrl", user.getPhotoUrl()); + result.put("providerData", FirebaseAuthenticationHelper.createUserProviderDataResult(user.getProviderData())); result.put("providerId", user.getProviderId()); result.put("tenantId", user.getTenantId()); result.put("uid", user.getUid()); @@ -136,6 +143,21 @@ public static JSObject createAdditionalUserInfoResult(@Nullable AdditionalUserIn return result; } + private static JSArray createUserProviderDataResult(List providerData) { + JSArray result = new JSArray(); + for (UserInfo userInfo : providerData) { + JSObject userInfoResult = new JSObject(); + userInfoResult.put("displayName", (userInfo.getDisplayName() == null ? JSONObject.NULL : userInfo.getDisplayName())); + userInfoResult.put("email", (userInfo.getEmail() == null ? JSONObject.NULL : userInfo.getEmail())); + userInfoResult.put("phoneNumber", (userInfo.getPhoneNumber() == null ? JSONObject.NULL : userInfo.getPhoneNumber())); + userInfoResult.put("photoUrl", (userInfo.getPhotoUrl() == null ? JSONObject.NULL : userInfo.getPhotoUrl())); + userInfoResult.put("providerId", userInfo.getProviderId()); + userInfoResult.put("uid", userInfo.getUid()); + result.put(userInfoResult); + } + return result; + } + private static String snakeToKebabCase(String snakeCase) { return snakeCase.replaceAll("_+", "-").toLowerCase(); } diff --git a/packages/authentication/ios/Plugin/FirebaseAuthenticationHelper.swift b/packages/authentication/ios/Plugin/FirebaseAuthenticationHelper.swift index d5a6d188..986ee413 100644 --- a/packages/authentication/ios/Plugin/FirebaseAuthenticationHelper.swift +++ b/packages/authentication/ios/Plugin/FirebaseAuthenticationHelper.swift @@ -66,6 +66,7 @@ public class FirebaseAuthenticationHelper { result["isAnonymous"] = user.isAnonymous result["phoneNumber"] = user.phoneNumber result["photoUrl"] = user.photoURL?.absoluteString + result["providerData"] = self.createUserProviderDataResult(user.providerData) result["providerId"] = user.providerID result["tenantId"] = user.tenantID result["uid"] = user.uid @@ -125,6 +126,21 @@ public class FirebaseAuthenticationHelper { return result } + private static func createUserProviderDataResult(_ providerData: [UserInfo]) -> JSArray { + var result = JSArray() + for userInfo in providerData { + var userInfoResult = JSObject() + userInfoResult["displayName"] = userInfo.displayName + userInfoResult["email"] = userInfo.email + userInfoResult["phoneNumber"] = userInfo.phoneNumber + userInfoResult["photoUrl"] = userInfo.photoURL?.absoluteString + userInfoResult["providerId"] = userInfo.providerID + userInfoResult["uid"] = userInfo.uid + result.append(userInfoResult) + } + return result + } + private static func convertErrorCodeToString(errorCode: Int) -> String? { let errorCodes: [Int: String] = [ AuthErrorCode.invalidCustomToken.rawValue: "invalid-custom-token", diff --git a/packages/authentication/src/definitions.ts b/packages/authentication/src/definitions.ts index b0047487..844f06e1 100644 --- a/packages/authentication/src/definitions.ts +++ b/packages/authentication/src/definitions.ts @@ -1044,6 +1044,7 @@ export interface UseEmulatorOptions { /** * @since 0.1.0 + * @see https://firebase.google.com/docs/reference/js/auth.user */ export interface User { /** @@ -1070,6 +1071,12 @@ export interface User { * @since 0.1.0 */ photoUrl: string | null; + /** + * Additional per provider such as displayName and profile information. + * + * @since 5.2.0 + */ + providerData: UserInfo[]; /** * @since 0.1.0 */ @@ -1084,6 +1091,49 @@ export interface User { uid: string; } +/** + * @since 5.2.0 + * @see https://firebase.google.com/docs/reference/js/auth.userinfo + */ +export interface UserInfo { + /** + * The display name of the user. + * + * @since 5.2.0 + */ + displayName: string | null; + /** + * The email of the user. + * + * @since 5.2.0 + */ + email: string | null; + /** + * The phone number normalized based on the E.164 standard (e.g. +16505550101) for the user. + * + * @since 5.2.0 + */ + phoneNumber: string | null; + /** + * The profile photo URL of the user. + * + * @since 5.2.0 + */ + photoUrl: string | null; + /** + * The provider used to authenticate the user. + * + * @since 5.2.0 + */ + providerId: string; + /** + * The user's unique ID. + * + * @since 5.2.0 + */ + uid: string; +} + /** * @since 0.1.0 */ diff --git a/packages/authentication/src/web.ts b/packages/authentication/src/web.ts index e1921a17..b56f502f 100644 --- a/packages/authentication/src/web.ts +++ b/packages/authentication/src/web.ts @@ -5,6 +5,7 @@ import type { CustomParameters as FirebaseCustomParameters, User as FirebaseUser, UserCredential as FirebaseUserCredential, + UserInfo as FirebaseUserInfo, } from 'firebase/auth'; import { EmailAuthProvider, @@ -85,6 +86,7 @@ import type { UpdateProfileOptions, UseEmulatorOptions, User, + UserInfo, } from './definitions'; import { Persistence, ProviderId } from './definitions'; @@ -696,6 +698,7 @@ export class FirebaseAuthenticationWeb isAnonymous: user.isAnonymous, phoneNumber: user.phoneNumber, photoUrl: user.photoURL, + providerData: this.createUserProviderDataResult(user.providerData), providerId: user.providerId, tenantId: user.tenantId, uid: user.uid, @@ -703,6 +706,19 @@ export class FirebaseAuthenticationWeb return result; } + private createUserProviderDataResult( + providerData: FirebaseUserInfo[], + ): UserInfo[] { + return providerData.map(data => ({ + displayName: data.displayName, + email: data.email, + phoneNumber: data.phoneNumber, + photoUrl: data.photoURL, + providerId: data.providerId, + uid: data.uid, + })); + } + private createAdditionalUserInfoResult( credential: FirebaseUserCredential | null, ): AdditionalUserInfo | null { From c31573de288aa2a71e365582af2f9eba553b1da5 Mon Sep 17 00:00:00 2001 From: Robin Genz Date: Tue, 19 Sep 2023 15:02:17 +0200 Subject: [PATCH 2/6] style: format --- .../firebase/authentication/FirebaseAuthenticationHelper.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/authentication/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/authentication/FirebaseAuthenticationHelper.java b/packages/authentication/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/authentication/FirebaseAuthenticationHelper.java index 93880a11..449a753d 100644 --- a/packages/authentication/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/authentication/FirebaseAuthenticationHelper.java +++ b/packages/authentication/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/authentication/FirebaseAuthenticationHelper.java @@ -9,11 +9,9 @@ import com.google.firebase.auth.FirebaseUser; import com.google.firebase.auth.OAuthCredential; import com.google.firebase.auth.UserInfo; - -import org.json.JSONObject; - import java.util.List; import java.util.Map; +import org.json.JSONObject; public class FirebaseAuthenticationHelper { From fdafef0c0431f8f63f1d471504acc4ab6e2c8ff3 Mon Sep 17 00:00:00 2001 From: Robin Genz Date: Tue, 19 Sep 2023 15:37:34 +0200 Subject: [PATCH 3/6] Add `UserMetadata` --- packages/authentication/README.md | 33 ++++++++++++------- .../FirebaseAuthenticationHelper.java | 12 +++++++ .../Plugin/FirebaseAuthenticationHelper.swift | 12 +++++++ packages/authentication/src/definitions.ts | 27 +++++++++++++++ packages/authentication/src/web.ts | 13 ++++++++ 5 files changed, 85 insertions(+), 12 deletions(-) diff --git a/packages/authentication/README.md b/packages/authentication/README.md index e6ff115a..5c470585 100644 --- a/packages/authentication/README.md +++ b/packages/authentication/README.md @@ -1513,18 +1513,27 @@ Remove all listeners for this plugin. #### User -| Prop | Type | Description | Since | -| ------------------- | --------------------------- | -------------------------------------------------------------------- | ----- | -| **`displayName`** | string \| null | | 0.1.0 | -| **`email`** | string \| null | | 0.1.0 | -| **`emailVerified`** | boolean | | 0.1.0 | -| **`isAnonymous`** | boolean | | 0.1.0 | -| **`phoneNumber`** | string \| null | | 0.1.0 | -| **`photoUrl`** | string \| null | | 0.1.0 | -| **`providerData`** | UserInfo[] | Additional per provider such as displayName and profile information. | 5.2.0 | -| **`providerId`** | string | | 0.1.0 | -| **`tenantId`** | string \| null | | 0.1.0 | -| **`uid`** | string | | 0.1.0 | +| Prop | Type | Description | Since | +| ------------------- | ----------------------------------------------------- | -------------------------------------------------------------------- | ----- | +| **`displayName`** | string \| null | | 0.1.0 | +| **`email`** | string \| null | | 0.1.0 | +| **`emailVerified`** | boolean | | 0.1.0 | +| **`isAnonymous`** | boolean | | 0.1.0 | +| **`metadata`** | UserMetadata | The user's metadata. | 5.2.0 | +| **`phoneNumber`** | string \| null | | 0.1.0 | +| **`photoUrl`** | string \| null | | 0.1.0 | +| **`providerData`** | UserInfo[] | Additional per provider such as displayName and profile information. | 5.2.0 | +| **`providerId`** | string | | 0.1.0 | +| **`tenantId`** | string \| null | | 0.1.0 | +| **`uid`** | string | | 0.1.0 | + + +#### UserMetadata + +| Prop | Type | Description | Since | +| -------------------- | ------------------- | ------------------------------------------- | ----- | +| **`creationTime`** | string | Time the user was created as UTC string. | 5.2.0 | +| **`lastSignInTime`** | string | Time the user last signed in as UTC string. | 5.2.0 | #### UserInfo diff --git a/packages/authentication/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/authentication/FirebaseAuthenticationHelper.java b/packages/authentication/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/authentication/FirebaseAuthenticationHelper.java index 449a753d..da16be18 100644 --- a/packages/authentication/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/authentication/FirebaseAuthenticationHelper.java +++ b/packages/authentication/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/authentication/FirebaseAuthenticationHelper.java @@ -7,6 +7,7 @@ import com.google.firebase.auth.AuthCredential; import com.google.firebase.auth.FirebaseAuthException; import com.google.firebase.auth.FirebaseUser; +import com.google.firebase.auth.FirebaseUserMetadata; import com.google.firebase.auth.OAuthCredential; import com.google.firebase.auth.UserInfo; import java.util.List; @@ -69,6 +70,7 @@ public static JSObject createUserResult(@Nullable FirebaseUser user) { result.put("email", user.getEmail()); result.put("emailVerified", user.isEmailVerified()); result.put("isAnonymous", user.isAnonymous()); + result.put("metadata", FirebaseAuthenticationHelper.createUserMetadataResult(user.getMetadata())); result.put("phoneNumber", user.getPhoneNumber()); result.put("photoUrl", user.getPhotoUrl()); result.put("providerData", FirebaseAuthenticationHelper.createUserProviderDataResult(user.getProviderData())); @@ -141,6 +143,16 @@ public static JSObject createAdditionalUserInfoResult(@Nullable AdditionalUserIn return result; } + private static JSObject createUserMetadataResult(@Nullable FirebaseUserMetadata metadata) { + JSObject result = new JSObject(); + if (metadata == null) { + return result; + } + result.put("creationTime", metadata.getCreationTimestamp()); + result.put("lastSignInTime", metadata.getLastSignInTimestamp()); + return result; + } + private static JSArray createUserProviderDataResult(List providerData) { JSArray result = new JSArray(); for (UserInfo userInfo : providerData) { diff --git a/packages/authentication/ios/Plugin/FirebaseAuthenticationHelper.swift b/packages/authentication/ios/Plugin/FirebaseAuthenticationHelper.swift index 986ee413..4b8d5ded 100644 --- a/packages/authentication/ios/Plugin/FirebaseAuthenticationHelper.swift +++ b/packages/authentication/ios/Plugin/FirebaseAuthenticationHelper.swift @@ -64,6 +64,7 @@ public class FirebaseAuthenticationHelper { result["email"] = user.email result["emailVerified"] = user.isEmailVerified result["isAnonymous"] = user.isAnonymous + result["metadata"] = self.createUserMetadataResult(user.metadata) result["phoneNumber"] = user.phoneNumber result["photoUrl"] = user.photoURL?.absoluteString result["providerData"] = self.createUserProviderDataResult(user.providerData) @@ -126,6 +127,17 @@ public class FirebaseAuthenticationHelper { return result } + private static func createUserMetadataResult(_ metadata: UserMetadata) -> JSObject { + var result = JSObject() + if let creationDate = metadata.creationDate?.timeIntervalSince1970 { + result["creationTime"] = creationDate + } + if let lastSignInDate = metadata.lastSignInDate?.timeIntervalSince1970 { + result["lastSignInTime"] = lastSignInDate + } + return result + } + private static func createUserProviderDataResult(_ providerData: [UserInfo]) -> JSArray { var result = JSArray() for userInfo in providerData { diff --git a/packages/authentication/src/definitions.ts b/packages/authentication/src/definitions.ts index 844f06e1..d94ab0e1 100644 --- a/packages/authentication/src/definitions.ts +++ b/packages/authentication/src/definitions.ts @@ -1063,6 +1063,12 @@ export interface User { * @since 0.1.0 */ isAnonymous: boolean; + /** + * The user's metadata. + * + * @since 5.2.0 + */ + metadata: UserMetadata; /** * @since 0.1.0 */ @@ -1134,6 +1140,27 @@ export interface UserInfo { uid: string; } +/** + * @since 5.2.0 + * @see https://firebase.google.com/docs/reference/js/auth.usermetadata + */ +export interface UserMetadata { + /** + * Time the user was created as UTC string. + * + * @since 5.2.0 + * @example "Wed, 14 Jun 2017 07:00:00 GMT" + */ + creationTime?: string; + /** + * Time the user last signed in as UTC string. + * + * @since 5.2.0 + * @example "Wed, 21 Jun 2017 07:00:00 GMT" + */ + lastSignInTime?: string; +} + /** * @since 0.1.0 */ diff --git a/packages/authentication/src/web.ts b/packages/authentication/src/web.ts index b56f502f..71125ec7 100644 --- a/packages/authentication/src/web.ts +++ b/packages/authentication/src/web.ts @@ -6,6 +6,7 @@ import type { User as FirebaseUser, UserCredential as FirebaseUserCredential, UserInfo as FirebaseUserInfo, + UserMetadata as FirebaseUserMeatdata, } from 'firebase/auth'; import { EmailAuthProvider, @@ -87,6 +88,7 @@ import type { UseEmulatorOptions, User, UserInfo, + UserMetadata, } from './definitions'; import { Persistence, ProviderId } from './definitions'; @@ -696,6 +698,7 @@ export class FirebaseAuthenticationWeb email: user.email, emailVerified: user.emailVerified, isAnonymous: user.isAnonymous, + metadata: this.createUserMetadataResult(user.metadata), phoneNumber: user.phoneNumber, photoUrl: user.photoURL, providerData: this.createUserProviderDataResult(user.providerData), @@ -706,6 +709,16 @@ export class FirebaseAuthenticationWeb return result; } + private createUserMetadataResult( + metadata: FirebaseUserMeatdata, + ): UserMetadata { + const result: UserMetadata = { + creationTime: metadata.creationTime, + lastSignInTime: metadata.lastSignInTime, + }; + return result; + } + private createUserProviderDataResult( providerData: FirebaseUserInfo[], ): UserInfo[] { From daf9fc9f0b84abd85c31e0d4080bd0f3632459b4 Mon Sep 17 00:00:00 2001 From: Robin Genz Date: Tue, 19 Sep 2023 19:16:22 +0200 Subject: [PATCH 4/6] fixes --- .../ios/Plugin/FirebaseAuthenticationHelper.swift | 4 ++-- packages/authentication/src/definitions.ts | 12 ++++++------ packages/authentication/src/web.ts | 11 +++++++---- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/packages/authentication/ios/Plugin/FirebaseAuthenticationHelper.swift b/packages/authentication/ios/Plugin/FirebaseAuthenticationHelper.swift index 4b8d5ded..e0a8b632 100644 --- a/packages/authentication/ios/Plugin/FirebaseAuthenticationHelper.swift +++ b/packages/authentication/ios/Plugin/FirebaseAuthenticationHelper.swift @@ -130,10 +130,10 @@ public class FirebaseAuthenticationHelper { private static func createUserMetadataResult(_ metadata: UserMetadata) -> JSObject { var result = JSObject() if let creationDate = metadata.creationDate?.timeIntervalSince1970 { - result["creationTime"] = creationDate + result["creationTime"] = creationDate * 1000 } if let lastSignInDate = metadata.lastSignInDate?.timeIntervalSince1970 { - result["lastSignInTime"] = lastSignInDate + result["lastSignInTime"] = lastSignInDate * 1000 } return result } diff --git a/packages/authentication/src/definitions.ts b/packages/authentication/src/definitions.ts index d94ab0e1..133babcf 100644 --- a/packages/authentication/src/definitions.ts +++ b/packages/authentication/src/definitions.ts @@ -1146,19 +1146,19 @@ export interface UserInfo { */ export interface UserMetadata { /** - * Time the user was created as UTC string. + * Time the user was created in milliseconds since the epoch. * * @since 5.2.0 - * @example "Wed, 14 Jun 2017 07:00:00 GMT" + * @example 1695130859034 */ - creationTime?: string; + creationTime?: number; /** - * Time the user last signed in as UTC string. + * Time the user last signed in in milliseconds since the epoch. * * @since 5.2.0 - * @example "Wed, 21 Jun 2017 07:00:00 GMT" + * @example 1695130859034 */ - lastSignInTime?: string; + lastSignInTime?: number; } /** diff --git a/packages/authentication/src/web.ts b/packages/authentication/src/web.ts index 71125ec7..50038466 100644 --- a/packages/authentication/src/web.ts +++ b/packages/authentication/src/web.ts @@ -712,10 +712,13 @@ export class FirebaseAuthenticationWeb private createUserMetadataResult( metadata: FirebaseUserMeatdata, ): UserMetadata { - const result: UserMetadata = { - creationTime: metadata.creationTime, - lastSignInTime: metadata.lastSignInTime, - }; + const result: UserMetadata = {}; + if (metadata.creationTime) { + result.creationTime = Date.parse(metadata.creationTime); + } + if (metadata.lastSignInTime) { + result.lastSignInTime = Date.parse(metadata.lastSignInTime); + } return result; } From 8e41db2b04d72c8a411e663f84b6f621eb8a05f4 Mon Sep 17 00:00:00 2001 From: Robin Genz Date: Tue, 19 Sep 2023 19:17:13 +0200 Subject: [PATCH 5/6] wip --- packages/authentication/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/authentication/README.md b/packages/authentication/README.md index 5c470585..281dcaf2 100644 --- a/packages/authentication/README.md +++ b/packages/authentication/README.md @@ -1530,10 +1530,10 @@ Remove all listeners for this plugin. #### UserMetadata -| Prop | Type | Description | Since | -| -------------------- | ------------------- | ------------------------------------------- | ----- | -| **`creationTime`** | string | Time the user was created as UTC string. | 5.2.0 | -| **`lastSignInTime`** | string | Time the user last signed in as UTC string. | 5.2.0 | +| Prop | Type | Description | Since | +| -------------------- | ------------------- | ------------------------------------------------------------- | ----- | +| **`creationTime`** | number | Time the user was created in milliseconds since the epoch. | 5.2.0 | +| **`lastSignInTime`** | number | Time the user last signed in in milliseconds since the epoch. | 5.2.0 | #### UserInfo From f7e80f882e7f9699f4bbd98ef7d2cef51d0bc61e Mon Sep 17 00:00:00 2001 From: Robin Genz Date: Tue, 19 Sep 2023 19:18:03 +0200 Subject: [PATCH 6/6] docs --- .changeset/happy-cows-own.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/happy-cows-own.md b/.changeset/happy-cows-own.md index 35a839b6..35358491 100644 --- a/.changeset/happy-cows-own.md +++ b/.changeset/happy-cows-own.md @@ -2,4 +2,4 @@ '@capacitor-firebase/authentication': minor --- -feat: expose `providerData` property +feat: expose `providerData` and `metadata` property