@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.
Files changed (2) hide show
  1. package/edgeFirebase.ts +22 -30
  2. 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
- .then(() => {
701
- this.user.logInErrorMessage = "After Persistence"
702
- signInWithEmailAndPassword(
703
- this.auth,
704
- credentials.email,
705
- credentials.password
706
- )
707
- .then(() => {
708
- this.user.logInError = false;
709
- this.user.logInErrorMessage = "Login Sent to Firebase"
710
- })
711
- .catch((error) => {
712
- this.user.email = "";
713
- this.user.uid = null;
714
-
715
- this.user.loggedIn = false;
716
- this.user.logInError = true;
717
- this.user.logInErrorMessage = error.code + ": " + error.message;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgedev/firebase",
3
- "version": "1.5.9",
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": {