@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.
Files changed (2) hide show
  1. package/edgeFirebase.ts +24 -29
  2. 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
- .then(() => {
699
- signInWithEmailAndPassword(
700
- this.auth,
701
- credentials.email,
702
- credentials.password
703
- )
704
- .then(() => {
705
- this.user.logInError = false;
706
- this.user.logInErrorMessage = "Login Sent to Firebase"
707
- })
708
- .catch((error) => {
709
- this.user.email = "";
710
- this.user.uid = null;
711
-
712
- this.user.loggedIn = false;
713
- this.user.logInError = true;
714
- this.user.logInErrorMessage = error.code + ": " + error.message;
715
- });
716
- })
717
- .catch((error) => {
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgedev/firebase",
3
- "version": "1.5.8",
3
+ "version": "1.5.10",
4
4
  "description": "Vue 3 / Nuxt 3 Plugin or Nuxt 3 global composable for firebase authentication and firestore.",
5
5
  "main": "index.ts",
6
6
  "scripts": {