web-manager 3.1.45 → 3.1.47

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +23 -13
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -264,7 +264,7 @@ function Manager() {
264
264
  // if (This.properties.page.status.didSignUp) {
265
265
  var didSignUp = 'auth.didSignUp';
266
266
  var done;
267
- var hoursSinceCreation = Math.abs(new Date() - new Date(+user.metadata.a)) / 36e5;
267
+ var hoursSinceCreation = Math.abs(new Date() - new Date(+user.metadata.createdAt)) / 36e5;
268
268
 
269
269
  function _done() {
270
270
  if (!done) {
@@ -660,20 +660,30 @@ function Manager() {
660
660
  This.properties.meta.environment = utilities.get(configuration, 'global.settings.debug.environment', This.properties.meta.environment);
661
661
  This.properties.page.queryString = new URLSearchParams(window.location.search);
662
662
 
663
- var pageQueryString = This.properties.page.queryString
664
663
  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;
664
+ var redirect = false;
665
+
666
+ This.properties.page.queryString.forEach(function(value, key) {
667
+ if (key.startsWith('utm_')) {
668
+ store.set('utm.tags.' + key, value);
669
+ store.set('utm.timestamp', new Date().toISOString());
670
+ }
671
+
672
+ if (key === 'aff') {
673
+ store.set('affiliateCode', value);
674
+ }
675
+
676
+ if (key === 'redirect') {
677
+ // redirect = decodeURIComponent(value) // 9/22/23 - Removed this and replace without the decode
678
+ redirect = value;
679
+ }
680
+ })
681
+
682
+ if (redirect && This.isValidRedirectUrl(redirect)) {
683
+ return window.location.href = redirect;
674
684
  }
675
- var authRegex = /\/(signin|signup|forgot)\//;
676
- if (pagePathname.match(authRegex)) {
685
+
686
+ if (pagePathname.match(/\/(signin|signup|forgot)\//)) {
677
687
  import('./helpers/auth-pages.js')
678
688
  .then(function(mod) {
679
689
  mod.default()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-manager",
3
- "version": "3.1.45",
3
+ "version": "3.1.47",
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": {