web-manager 3.2.3 → 3.2.6

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/index.js +27 -16
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -58,8 +58,8 @@ function Manager() {
58
58
  code: '',
59
59
  url: '',
60
60
  status: {
61
- ready: false,
62
61
  initilizing: false,
62
+ ready: false,
63
63
  authReady: false,
64
64
  },
65
65
  // initReady: false,
@@ -737,8 +737,7 @@ function Manager() {
737
737
  ready: function (fn, options) {
738
738
  options = options || {};
739
739
  options.interval = options.interval || 100;
740
- // if ( (self.get('page.status.authReady', false) === false) ) {
741
- // Manager.log('--- authReady() REAL');
740
+
742
741
  if (!utilities.get(self, 'properties.page.status.authReady', false)) {
743
742
  setTimeout(function () {
744
743
  self.auth().ready(fn, options);
@@ -746,14 +745,15 @@ function Manager() {
746
745
  } else {
747
746
 
748
747
  // Set up listener for redirect (for provider login)
749
- if (!self._redirectResultSetup) {
750
- self._redirectResultSetup = true;
751
- firebase.auth()
752
- .getRedirectResult()
753
- .catch(function (error) {
754
- _displayError(error.message);
755
- });
756
- }
748
+ // @@@ DISABLED NOV 8, 2023
749
+ // if (!self._redirectResultSetup) {
750
+ // self._redirectResultSetup = true;
751
+ // firebase.auth()
752
+ // .getRedirectResult()
753
+ // .catch(function (error) {
754
+ // _displayError(error.message);
755
+ // });
756
+ // }
757
757
 
758
758
  // Performance
759
759
  self.performance().mark('manager_authReady');
@@ -794,10 +794,21 @@ function Manager() {
794
794
  // self.log('Error', error.message);
795
795
  });
796
796
  } else {
797
- firebase.auth().signInWithRedirect(new firebase.auth.OAuthProvider(method))
798
- .catch(function (e) {
799
- _displayError(e);
800
- })
797
+ // @@@ REMOVED NOV 6, 2023
798
+ // firebase.auth().signInWithRedirect(new firebase.auth.OAuthProvider(method))
799
+ // .catch(function (e) {
800
+ // _displayError(e);
801
+ // })
802
+
803
+ // @@@ ADDED NOV 6, 2023
804
+ var authDomain = self.properties.options.libraries.firebase_app.config.authDomain;
805
+ var newURL = new URL('https://' + authDomain + '/auth/handler');
806
+
807
+ newURL.searchParams.set('provider', method);
808
+ newURL.searchParams.set('destination', window.location.href);
809
+
810
+ window.location.href = newURL.toString();
811
+
801
812
  }
802
813
  },
803
814
  signUp: function(method, email, password, passwordConfirm) {
@@ -1092,7 +1103,7 @@ function Manager() {
1092
1103
  console.error(e);
1093
1104
  });
1094
1105
 
1095
- // SW Ready
1106
+ // Service Worker Ready
1096
1107
  // navigator.serviceWorker.ready.then(function(registration) {
1097
1108
  // });
1098
1109
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-manager",
3
- "version": "3.2.3",
3
+ "version": "3.2.6",
4
4
  "description": "Easily access important variables such as the query string, current domain, and current page in a single object.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -31,9 +31,9 @@
31
31
  }
32
32
  },
33
33
  "dependencies": {
34
- "@sentry/browser": "^7.72.0",
34
+ "@sentry/browser": "^7.77.0",
35
35
  "cookieconsent": "^3.1.1",
36
36
  "firebase": "^9.23.0",
37
37
  "lazysizes": "^5.3.2"
38
38
  }
39
- }
39
+ }