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