web-manager 3.1.4 → 3.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/lib/account.js +36 -10
  2. package/package.json +2 -2
package/lib/account.js CHANGED
@@ -194,9 +194,35 @@ function getMonth(date) {
194
194
  return monthNames[date.getMonth()];
195
195
  }
196
196
 
197
- Account.prototype._resolveAccount = function (currentUser, account, options) {
197
+ Account.prototype._resolveAccount2 = function (firebaseUser, account, options) {
198
+ // TODO: USE resolve-account library Instead
199
+
200
+ /*
201
+ const resolver = new (require('resolve-account'))({
202
+ Manager: self.Manager,
203
+ utilities: utilities,
204
+ dom: dom,
205
+ });
206
+
207
+
208
+ self.properties = resolver.resolve(firebaseUser, account, options)
209
+
210
+ return self.properties;
211
+
212
+ */
213
+
214
+ }
215
+
216
+ /*
217
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
218
+ THIS HAS BEEN MOVED TO the resolve-account lib
219
+ still here until figure out how to import resolve-account here
220
+ any changes to resolve-account must go here too
221
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
222
+ */
223
+ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
198
224
  var self = this;
199
- currentUser = currentUser || {};
225
+ firebaseUser = firebaseUser || {};
200
226
  account = account || {};
201
227
  options = options || {};
202
228
 
@@ -207,8 +233,8 @@ Account.prototype._resolveAccount = function (currentUser, account, options) {
207
233
 
208
234
  // Resolve auth
209
235
  account.auth = account.auth || {};
210
- account.auth.email = account.auth.email || currentUser.email || null;
211
- account.auth.uid = account.auth.uid || currentUser.uid || null;
236
+ account.auth.email = account.auth.email || firebaseUser.email || null;
237
+ account.auth.uid = account.auth.uid || firebaseUser.uid || null;
212
238
  account.auth.temporary = account.auth.temporary || false;
213
239
 
214
240
  // Resolve plan
@@ -276,8 +302,8 @@ Account.prototype._resolveAccount = function (currentUser, account, options) {
276
302
 
277
303
  // Resolve oAuth2
278
304
  account.oauth2 = account.oauth2 || {};
279
- account.oauth2.discord = account.oauth2.discord || {};
280
- account.oauth2.discord.user = account.oauth2.discord.user || {};
305
+ // account.oauth2.discord = account.oauth2.discord || {};
306
+ // account.oauth2.discord.user = account.oauth2.discord.user || {};
281
307
 
282
308
  // Resolve roles
283
309
  account.roles = account.roles || {};
@@ -359,13 +385,13 @@ Account.prototype._resolveAccount = function (currentUser, account, options) {
359
385
 
360
386
  authCreatedEl.setInnerHTML(
361
387
  new Date(
362
- parseInt(utilities.get(currentUser, 'metadata.a', '0'))
388
+ parseInt(utilities.get(firebaseUser, 'metadata.a', '0'))
363
389
  )
364
390
  .toLocaleString(undefined, {
365
391
  weekday: 'long', year: 'numeric', month: 'long', day: 'numeric',
366
392
  })
367
393
  )
368
- authPhoneInput.setInnerHTML(currentUser.phoneNumber).setValue(currentUser.phoneNumber)
394
+ authPhoneInput.setInnerHTML(firebaseUser.phoneNumber).setValue(firebaseUser.phoneNumber)
369
395
 
370
396
  billingSubscribeBtn.setAttribute('hidden', true);
371
397
  billingUpdateBtn.setAttribute('hidden', true);
@@ -374,8 +400,8 @@ Account.prototype._resolveAccount = function (currentUser, account, options) {
374
400
  updateURL.searchParams.set('appName', utilities.get(self.Manager, 'properties.global.brand.name', 'Unknown'));
375
401
  updateURL.searchParams.set('supportUrl', currentURL.origin + '/support');
376
402
  updateURL.searchParams.set('supportEmail', utilities.get(self.Manager, 'properties.contact.emailSupport', 'unknown@email.com'));
377
- updateURL.searchParams.set('userEmail', currentUser.email);
378
- updateURL.searchParams.set('userId', currentUser.uid);
403
+ updateURL.searchParams.set('userEmail', firebaseUser.email);
404
+ updateURL.searchParams.set('userId', firebaseUser.uid);
379
405
  updateURL.searchParams.set('orderId', account.plan.payment.orderId);
380
406
  updateURL.searchParams.set('resourceId', account.plan.payment.resourceId);
381
407
  billingUpdateBtn.removeAttribute('hidden').setAttribute('href', updateURL.toString());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-manager",
3
- "version": "3.1.4",
3
+ "version": "3.1.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": {
@@ -28,4 +28,4 @@
28
28
  "firebase": "^8.10.1",
29
29
  "lazysizes": "^5.3.2"
30
30
  }
31
- }
31
+ }