Skip to content
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

Fastboot mode, isAuthenticated always fasle #1690

Closed
loxmys opened this issue Oct 5, 2018 · 3 comments · Fixed by ember-cli/ember-fetch#137
Closed

Fastboot mode, isAuthenticated always fasle #1690

loxmys opened this issue Oct 5, 2018 · 3 comments · Fixed by ember-cli/ember-fetch#137

Comments

@loxmys
Copy link

loxmys commented Oct 5, 2018

I'm enable the cookie store

// app/session-stores/application.js
import CookieStore from 'ember-simple-auth/session-stores/cookie';
export default CookieStore.extend();

in route

if (this.get('session.isAuthenticated')) {
  this.transitionTo('private.transactions');
} else {
  this.transitionTo('login', { queryParams: { previousUrl: 'private.transactions' } });
}

Cookies added after logging in, but this.get('session.isAuthenticated') always false.
Do you know how i can get session.isAuthenticated in fastboot mode?

@marcoow
Copy link
Member

marcoow commented Oct 22, 2018

Hm, this should work out-of-the-box. Which authenticator are you using and what do the session contents look like?

@marcoow marcoow added the triage label Oct 22, 2018
@bobisjan
Copy link

bobisjan commented Oct 26, 2018

We have recently experienced this behaviour in our application too. It seems to be broken with v1.7.0, using v1.6.0 works for us as expected.

As far as I can tell, #1608 causes the issue, still I'm not sure what is the root cause here, the problem is with requiring AbortController polyfill ember-cli/ember-fetch#115 and ember-fastboot/fastboot#198.

The reason for that it's not clear what's going on is that ESA "hides" an error here https://github.com/simplabs/ember-simple-auth/blob/master/addon/initializers/setup-session-restoration.js#L18.

@marcoow
Copy link
Member

marcoow commented Nov 9, 2018

This seems to be an ember-fetch/fastboot issue - @mike-north has a good write-up on the cause here: ember-cli/ember-fetch#115 (comment)

@marcoow marcoow closed this as completed Nov 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants