initial commit
This commit is contained in:
21
app/routes/application.js
Normal file
21
app/routes/application.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import Route from '@ember/routing/route';
|
||||
import { service } from '@ember/service';
|
||||
import { warn } from '@ember/debug';
|
||||
|
||||
export default class ApplicationRoute extends Route {
|
||||
@service router;
|
||||
@service session;
|
||||
@service currentSession;
|
||||
|
||||
async beforeModel() {
|
||||
await this.session.setup();
|
||||
return this._loadCurrentSession();
|
||||
}
|
||||
|
||||
_loadCurrentSession() {
|
||||
return this.currentSession.load().catch((e) => {
|
||||
warn(e, { id: 'session-load-failure' });
|
||||
this.session.invalidate();
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user