@edgedev/firebase 1.9.9 → 1.9.11

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 +13 -3
  2. package/package.json +2 -2
package/edgeFirebase.ts CHANGED
@@ -195,7 +195,8 @@ export const EdgeFirebase = class {
195
195
  emulatorFirestore: "",
196
196
  emulatorFunctions: ""
197
197
  },
198
- isPersistant: false
198
+ isPersistant: false,
199
+ enablePopupRedirect: false,
199
200
  ) {
200
201
  this.firebaseConfig = firebaseConfig;
201
202
  this.app = initializeApp(this.firebaseConfig);
@@ -203,8 +204,11 @@ export const EdgeFirebase = class {
203
204
  if (isPersistant) {
204
205
  persistence = browserLocalPersistence;
205
206
  }
206
-
207
- this.auth = initializeAuth(this.app, { persistence, popupRedirectResolver: browserPopupRedirectResolver });
207
+ if (enablePopupRedirect) {
208
+ this.auth = initializeAuth(this.app, { persistence, popupRedirectResolver: browserPopupRedirectResolver });
209
+ } else {
210
+ this.auth = initializeAuth(this.app, { persistence });
211
+ }
208
212
  if (this.firebaseConfig.emulatorAuth) {
209
213
  connectAuthEmulator(this.auth, `http://localhost:${this.firebaseConfig.emulatorAuth}`)
210
214
  }
@@ -810,6 +814,7 @@ export const EdgeFirebase = class {
810
814
  if (role) {
811
815
  ruleCheck.permissionCheckPath = permissionCheck;
812
816
  ruleCheck.permissionType = "roles";
817
+
813
818
  }
814
819
  const specialPermission = this.user.specialPermissions.find(
815
820
  (r) => r.collectionPath === permissionCheck
@@ -818,6 +823,11 @@ export const EdgeFirebase = class {
818
823
  ruleCheck.permissionCheckPath = permissionCheck;
819
824
  ruleCheck.permissionType = "specialPermissions";
820
825
  }
826
+ if (ruleCheck.permissionType !== "") {
827
+ if (this.permissionCheckOnly(action, permissionCheck)) {
828
+ break;
829
+ }
830
+ }
821
831
  index--;
822
832
  }
823
833
  const rootRole = this.user.roles.find((r) => r.collectionPath === "-");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgedev/firebase",
3
- "version": "1.9.9",
3
+ "version": "1.9.11",
4
4
  "description": "Vue 3 / Nuxt 3 Plugin or Nuxt 3 plugin for firebase authentication and firestore.",
5
5
  "main": "index.ts",
6
6
  "scripts": {
@@ -37,4 +37,4 @@
37
37
  "firebase": "^9.12.1",
38
38
  "vue": "^3.0.0"
39
39
  }
40
- }
40
+ }