@edgedev/firebase 1.5.8 → 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 +24 -29
- package/package.json +1 -1
package/edgeFirebase.ts
CHANGED
|
@@ -687,41 +687,36 @@ 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
|
+
this.user.logInErrorMessage = "Initial Click"
|
|
691
692
|
try {
|
|
692
693
|
this.logOut();
|
|
694
|
+
this.user.logInErrorMessage = "After Logout"
|
|
693
695
|
let persistence: Persistence = browserSessionPersistence;
|
|
694
696
|
if (isPersistant) {
|
|
695
697
|
persistence = browserLocalPersistence;
|
|
696
698
|
}
|
|
697
|
-
setPersistence(this.auth, persistence)
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
.
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
this.user.email = "";
|
|
719
|
-
this.user.uid = null;
|
|
720
|
-
|
|
721
|
-
this.user.loggedIn = false;
|
|
722
|
-
this.user.logInError = true;
|
|
723
|
-
this.user.logInErrorMessage = error.code + ": " + error.message;
|
|
724
|
-
});
|
|
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
|
+
});
|
|
725
720
|
} catch (error) {
|
|
726
721
|
this.user.email = "";
|
|
727
722
|
this.user.uid = null;
|