mirror of
https://gitlab.silvrtree.co.uk/martind2000/censis-archive.git
synced 2025-02-03 14:50:13 +00:00
19 lines
551 B
JavaScript
19 lines
551 B
JavaScript
|
import Ember from 'ember';
|
||
|
import ApplicationRouteMixin from 'ember-simple-auth/mixins/application-route-mixin';
|
||
|
|
||
|
const { service } = Ember.inject;
|
||
|
|
||
|
export default Ember.Route.extend(ApplicationRouteMixin, {
|
||
|
sessionAccount: service('session-account'),
|
||
|
_loadCurrentUser() {
|
||
|
return this.get('sessionAccount').loadCurrentUser();
|
||
|
},
|
||
|
beforeModel() {
|
||
|
return this._loadCurrentUser();
|
||
|
},
|
||
|
sessionAuthenticated() {
|
||
|
this._super(...arguments);
|
||
|
this._loadCurrentUser().catch(() => this.get('session').invalidate());
|
||
|
}
|
||
|
});
|