-
Notifications
You must be signed in to change notification settings - Fork 603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Session service not instantiated in Fastboot #1138
Comments
The issue seems to be gone now, possibly after reinstalling all npm packages. Can be closed. |
I'm having this same problem with ESA 1.2.0. The cookie is being read correctly from the headers, but in my application.js I've tried removing node_modules, dist & tmp and rebuilt and it's not made a difference. @sevab, can you think of any other possible way you may have resolved this issue? |
@willviles Did you do I'd try clearing cookies too. |
Yeah, I've cleared the cookies and ensured I nuked all dependencies, doing an However, I think I've honed in on the problem. After hours of logging to the Fastboot console, I noticed ESA was breaking (with no error) at internal-session.js#L73, when attempting to lookup my authenticator. I'm using the oAuth2 Password Grant Authenticator, however I'm wondering whether the lookup of the authenticator is failing because when setting Can anyone else confirm this cookie restoration problem when using the oAuth2 authenticator? @marcoow is there any reason ESA could be blowing up at internal-session.js#L73? For reference, I'm using the following versions: "ember-cli": "2.10.0",
"ember-cli-fastboot": "1.0.0-beta.15",
"ember-cookies": "0.0.12",
"ember-simple-auth": "1.2.0" |
I've figured it. The OAuth2 Password Grant Authenticator imports "fastbootDependencies": [
"node-fetch"
] I only discovered this by using Node debugger and following the stack trace through. No exception was thrown in the console. |
@willviles: can you create an issue for that? We should automatically add |
@marcoow, pull request above covers the issue! See the Requiring Node Modules section of the Fastboot addon author guide. |
This exact same problem with restoring the session from the cookie store via Fastboot has reared its ugly head again. ESA I've pinpointed the exact failing commit to 275b805, which updates Ember Fetch to Will update if I find a fix... |
argh, I'm not a fan of these depend-on-the-latest-thats-available @greenkeeperio changes anyway… Let us know what you find. |
Simply downgrading Ember Fetch to I can't seem to get node-inspector to work with Fastboot >1.0.0, otherwise I'd be able to use the debugger to dig a little deeper into exactly what's failing with Ember Fetch. Here's a related issue perhaps: ember-cli/ember-fetch#55. |
@willviles: which |
@marcoow Latest release |
Do you see any errors? When running |
From running it successfully in node inspector beforehand, I remember From logging around it, internal-session.js#73 is where it just fails without any exception and ends the |
Hm that seems unrelated to FastBoot though… |
You would think... but I've just changed Must be because they've changed the way (see here) Fastboot apps require and expose Two options I suppose:
|
Hm, that would mean that https://github.com/ember-cli/ember-fetch/blob/master/package.json#L51 is wrong as well. Looks like you should open an issue on ember-cli/ember-fetch. |
@marcoow I've been able to debug this in Fastboot using Node 8.4.0 and the Chrome debugger. Wrapping internal-session.js -> _lookupAuthenticator in a try/catch block throws the following error:
Going function-by-function in the debugger finally yields:
I've tried adding The only way I can get this working is by installing the Ember Fetch addon directly in my app. And then I can remove Any idea why the |
@willviles: if it works when you add ember-fetch to your app directly but not if it's only installed as a sub-dependency through ember-simple-auth that still looks like a bug in ember-fetch to me (it not working correctly in FastBoot when installed as a sub dependency). |
Even I add node-fetch to fastbootDependencies I still meet the same problem |
I have just upgraded to master and started integrating
ember-simple-auth
with fastboot, switching to Cookie session store from Adaptive as instructed.However the session's state doesn't seem to be instantiated on the server. While
ember_simple_auth-session
cookie is present with all the necessary data, thesession.isAuthenticated
still returnsfalse
andsession.data
is empty in fastboot mode:On the frontend the same code works as expected returning true for
session.isAuthenticated
and restoringsession.data
from cookie.Not sure if I'm doing something wrong, or if this is a bug.
The text was updated successfully, but these errors were encountered: