@edgedev/firebase 1.5.9 → 1.5.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/edgeFirebase.ts +22 -30
- package/package.json +1 -1
package/edgeFirebase.ts
CHANGED
|
@@ -687,7 +687,7 @@ export const EdgeFirebase = class {
|
|
|
687
687
|
};
|
|
688
688
|
|
|
689
689
|
// Composable to login and set persistence
|
|
690
|
-
public logIn = (credentials: Credentials, isPersistant = false): void => {
|
|
690
|
+
public logIn = async (credentials: Credentials, isPersistant = false): Promise<void> => {
|
|
691
691
|
this.user.logInErrorMessage = "Initial Click"
|
|
692
692
|
try {
|
|
693
693
|
this.logOut();
|
|
@@ -696,35 +696,27 @@ export const EdgeFirebase = class {
|
|
|
696
696
|
if (isPersistant) {
|
|
697
697
|
persistence = browserLocalPersistence;
|
|
698
698
|
}
|
|
699
|
-
setPersistence(this.auth, persistence)
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
.catch((error) => {
|
|
721
|
-
this.user.email = "";
|
|
722
|
-
this.user.uid = null;
|
|
723
|
-
|
|
724
|
-
this.user.loggedIn = false;
|
|
725
|
-
this.user.logInError = true;
|
|
726
|
-
this.user.logInErrorMessage = error.code + ": " + error.message;
|
|
727
|
-
});
|
|
699
|
+
await setPersistence(this.auth, persistence);
|
|
700
|
+
|
|
701
|
+
this.user.logInErrorMessage = "After Persistence"
|
|
702
|
+
|
|
703
|
+
signInWithEmailAndPassword(
|
|
704
|
+
this.auth,
|
|
705
|
+
credentials.email,
|
|
706
|
+
credentials.password
|
|
707
|
+
)
|
|
708
|
+
.then(() => {
|
|
709
|
+
this.user.logInError = false;
|
|
710
|
+
this.user.logInErrorMessage = "Login Sent to Firebase"
|
|
711
|
+
})
|
|
712
|
+
.catch((error) => {
|
|
713
|
+
this.user.email = "";
|
|
714
|
+
this.user.uid = null;
|
|
715
|
+
|
|
716
|
+
this.user.loggedIn = false;
|
|
717
|
+
this.user.logInError = true;
|
|
718
|
+
this.user.logInErrorMessage = error.code + ": " + error.message;
|
|
719
|
+
});
|
|
728
720
|
} catch (error) {
|
|
729
721
|
this.user.email = "";
|
|
730
722
|
this.user.uid = null;
|