@edgedev/firebase 1.5.6 → 1.5.8
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 +17 -8
- package/package.json +1 -1
package/edgeFirebase.ts
CHANGED
|
@@ -274,7 +274,6 @@ export const EdgeFirebase = class {
|
|
|
274
274
|
this.user.uid = null;
|
|
275
275
|
this.user.loggedIn = false;
|
|
276
276
|
this.user.logInError = false;
|
|
277
|
-
this.user.logInErrorMessage = "";
|
|
278
277
|
}
|
|
279
278
|
});
|
|
280
279
|
};
|
|
@@ -689,12 +688,13 @@ export const EdgeFirebase = class {
|
|
|
689
688
|
|
|
690
689
|
// Composable to login and set persistence
|
|
691
690
|
public logIn = (credentials: Credentials, isPersistant = false): void => {
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
691
|
+
try {
|
|
692
|
+
this.logOut();
|
|
693
|
+
let persistence: Persistence = browserSessionPersistence;
|
|
694
|
+
if (isPersistant) {
|
|
695
|
+
persistence = browserLocalPersistence;
|
|
696
|
+
}
|
|
697
|
+
setPersistence(this.auth, persistence)
|
|
698
698
|
.then(() => {
|
|
699
699
|
signInWithEmailAndPassword(
|
|
700
700
|
this.auth,
|
|
@@ -702,7 +702,8 @@ export const EdgeFirebase = class {
|
|
|
702
702
|
credentials.password
|
|
703
703
|
)
|
|
704
704
|
.then(() => {
|
|
705
|
-
|
|
705
|
+
this.user.logInError = false;
|
|
706
|
+
this.user.logInErrorMessage = "Login Sent to Firebase"
|
|
706
707
|
})
|
|
707
708
|
.catch((error) => {
|
|
708
709
|
this.user.email = "";
|
|
@@ -721,6 +722,14 @@ export const EdgeFirebase = class {
|
|
|
721
722
|
this.user.logInError = true;
|
|
722
723
|
this.user.logInErrorMessage = error.code + ": " + error.message;
|
|
723
724
|
});
|
|
725
|
+
} catch (error) {
|
|
726
|
+
this.user.email = "";
|
|
727
|
+
this.user.uid = null;
|
|
728
|
+
|
|
729
|
+
this.user.loggedIn = false;
|
|
730
|
+
this.user.logInError = true;
|
|
731
|
+
this.user.logInErrorMessage = JSON.stringify(error);
|
|
732
|
+
}
|
|
724
733
|
};
|
|
725
734
|
|
|
726
735
|
// Keeping this for reference on how to Type a Ref.
|