Skip to content

Commit

Permalink
test: use session#setup in test-app
Browse files Browse the repository at this point in the history
  • Loading branch information
BobrImperator committed Oct 7, 2021
1 parent 74542a9 commit cddfd74
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/test-app/app/routes/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ export default Route.extend({
session: service(),
sessionAccount: service(),

beforeModel() {
async beforeModel() {
await this.session.setup();
return this.get('sessionAccount').loadCurrentUser().catch(() => this.get('session').invalidate());
}
});
4 changes: 3 additions & 1 deletion packages/test-app/ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ const EmberApp = require('ember-cli/lib/broccoli/ember-app');

module.exports = function(defaults) {
let app = new EmberApp(defaults, {
// Add options here
'ember-simple-auth': {
useSessionSetupMethod: true,
},
});

// Use `app.import` to add additional libraries to the generated
Expand Down

0 comments on commit cddfd74

Please sign in to comment.