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

Issue integrating with fastboot #148

Open
napafundi opened this issue Feb 12, 2020 · 2 comments
Open

Issue integrating with fastboot #148

napafundi opened this issue Feb 12, 2020 · 2 comments

Comments

@napafundi
Copy link

When using ember-cognito with fastboot, page refreshing logs the user out.

After refreshing, I get an error : The authenticator "authenticator:cognito" rejected to restore the session - invalidating…. This doesn't occur when fastboot is disabled. I'm using a CookieStore as described in the ember-simple-auth docs as well as a current-user service as described in docs here.

@paulcwatts
Copy link
Collaborator

Hi @napafundi , sorry for taking so long to get back to you.

Unfortunately I've not found much success with using the CookieStore, Cognito and Fastboot. The biggest issue is that the JWT created by Cognito is too large to be stored in the cookie store.

I'm not sure what is causing the restore to be rejected -- you can try debugging into the authenticator's restore method to see. But I suspect it has something to do with the issues of the cookie being too large.

@hoIIer
Copy link

hoIIer commented Mar 11, 2022

@napafundi as a workaround you can do:

export default class IndexRoute extends Route {
  @service fastboot;
  @service session;

  beforeModel(transition) {
    if (!this.fastboot.isFastBoot) {
      this.session.requireAuthentication(transition, 'login');
    }
  }
}

Depending how you're running fastboot and what your needs are, having auth info may only be required when the regular app loads.

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

No branches or pull requests

3 participants