web-manager 3.1.4 → 3.1.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.
- package/lib/account.js +36 -10
- 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.
|
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
|
-
|
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 ||
|
211
|
-
account.auth.uid = account.auth.uid ||
|
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(
|
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(
|
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',
|
378
|
-
updateURL.searchParams.set('userId',
|
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.
|
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
|
+
}
|