You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is from my experience of setting up ESA at the weekend. It could be that my solutions are not the best, or that the problems are covered in the docs and I just didn't read thoroughly enough.
Setting up log in redirects import Route from '@ember/routing/route';
import ApplicationRouteMixin from 'ember-simple-auth/mixins/application-route-mixin';
import{mock}from'ember-data-factory-guy';test('after successful login the user is redirected to the dashboard',asyncfunction(assert){mock({type: 'POST',url: '/token',responseText: {access_token: 'rubbish'}});awaitvisit('/login');awaitclick('[data-test-login-button]');assert.equal(currentURL(),'/dashboard','The user is redirected to dashboard after login');});
The text was updated successfully, but these errors were encountered:
This is from my experience of setting up ESA at the weekend. It could be that my solutions are not the best, or that the problems are covered in the docs and I just didn't read thoroughly enough.
Setting up log in redirects import Route from '@ember/routing/route';
import ApplicationRouteMixin from 'ember-simple-auth/mixins/application-route-mixin';
OR
But the latter causes issues in the test, it’s not up to date. Far simpler to use the mixin and override that property.
The already authenticated redirect
Testing - mock already logged in for your protected routes
Easy when you know it.
Testing - respond to login correctly in test
The text was updated successfully, but these errors were encountered: