@iebh/tera-fy 1.0.19 → 1.0.20

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.
@@ -417,8 +417,16 @@ export default class TeraFyServer {
417
417
 
418
418
  // Create a listener for the message from the downstream window to resolve the promise
419
419
  let listenMessages = ({data}) => {
420
- if (data.TERA && data.action == 'noop' && data.isLoggedIn) { // Signal sent from landing page - we're logged in, yey!
421
- this.debug('Received ok message from popup window');
420
+ if (data.TERA && data.action == 'popupUserState' && data.user) { // Signal sent from landing page - we're logged in, yey!
421
+ let $auth = app.service('$auth');
422
+
423
+ // Accept user polyfill from opener
424
+ $auth.state = 'user';
425
+ $auth.ready = true;
426
+ $auth.isLoggedIn = true;
427
+ $auth.user = data.user;
428
+
429
+ this.debug('Received user auth from popup window', {'$auth.user': $auth.user});
422
430
  waitOnWindowAuth.resolve();
423
431
  }
424
432
  };
@@ -444,15 +452,6 @@ export default class TeraFyServer {
444
452
  // Disable overlay content
445
453
  this.uiSplat(false);
446
454
 
447
- // Tell $auth to forcibly refresh its user data
448
- await app.service('$auth').restoreLogin();
449
-
450
- // Sanity Check against the login that should have been restored
451
- if (!app.service('$auth').isLoggedIn) {
452
- console.warn('Expecting tera-server to have restored $auth.user - but its still not logged in!');
453
- debugger;
454
- }
455
-
456
455
  // ... then refresh the project list as we're likely going to need it
457
456
  await app.service('$projects').refresh();
458
457
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iebh/tera-fy",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "description": "TERA website worker",
5
5
  "scripts": {
6
6
  "dev": "esbuild --platform=browser --format=esm --bundle lib/terafy.client.js --outfile=dist/terafy.js --minify --serve --servedir=.",