web-manager 3.1.46 → 3.1.48

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 +24 -15
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -262,19 +262,18 @@ function Manager() {
262
262
  function _authHandle_in(This, user) {
263
263
  // This.log('_authHandle_in', user);
264
264
  // if (This.properties.page.status.didSignUp) {
265
- var didSignUp = 'auth.didSignUp';
266
265
  var done;
267
266
  var hoursSinceCreation = Math.abs(new Date() - new Date(+user.metadata.createdAt)) / 36e5;
268
267
 
269
268
  function _done() {
270
269
  if (!done) {
271
270
  done = true;
272
- store.set(didSignUp, true)
271
+ store.set('didSignUp', true)
273
272
  _authHandle_in_normal(This, user);
274
273
  }
275
274
  }
276
275
 
277
- if (!store.get(didSignUp) && hoursSinceCreation < 0.5) {
276
+ if (!store.get('didSignUp') && hoursSinceCreation < 0.5) {
278
277
  user.getIdToken(false)
279
278
  .then(function(token) {
280
279
 
@@ -660,20 +659,30 @@ function Manager() {
660
659
  This.properties.meta.environment = utilities.get(configuration, 'global.settings.debug.environment', This.properties.meta.environment);
661
660
  This.properties.page.queryString = new URLSearchParams(window.location.search);
662
661
 
663
- var pageQueryString = This.properties.page.queryString
664
662
  var pagePathname = window.location.pathname;
665
- var qsAff = pageQueryString.get('aff');
666
- if (qsAff) {
667
- // store.set('auth.affiliateCode', qsAff);
668
- store.set('affiliateCode', qsAff);
669
- }
670
- var qsRedirect = pageQueryString.get('redirect');
671
- if (qsRedirect && This.isValidRedirectUrl(qsRedirect)) {
672
- window.location.href = decodeURIComponent(qsRedirect);
673
- return;
663
+ var redirect = false;
664
+
665
+ This.properties.page.queryString.forEach(function(value, key) {
666
+ if (key.startsWith('utm_')) {
667
+ store.set('utm.tags.' + key, value);
668
+ store.set('utm.timestamp', new Date().toISOString());
669
+ }
670
+
671
+ if (key === 'aff') {
672
+ store.set('affiliateCode', value);
673
+ }
674
+
675
+ if (key === 'redirect') {
676
+ // redirect = decodeURIComponent(value) // 9/22/23 - Removed this and replace without the decode
677
+ redirect = value;
678
+ }
679
+ })
680
+
681
+ if (redirect && This.isValidRedirectUrl(redirect)) {
682
+ return window.location.href = redirect;
674
683
  }
675
- var authRegex = /\/(signin|signup|forgot)\//;
676
- if (pagePathname.match(authRegex)) {
684
+
685
+ if (pagePathname.match(/\/(signin|signup|forgot)\//)) {
677
686
  import('./helpers/auth-pages.js')
678
687
  .then(function(mod) {
679
688
  mod.default()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-manager",
3
- "version": "3.1.46",
3
+ "version": "3.1.48",
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": {