2023-02-17 13:25:51 +03:00
|
|
|
import AuthenticatedRoute from './authenticated';
|
|
|
|
import {inject as service} from '@ember/service';
|
|
|
|
|
|
|
|
// need this to be authenticated
|
|
|
|
export default class WebsocketRoute extends AuthenticatedRoute {
|
|
|
|
@service session;
|
2023-10-09 10:12:46 +03:00
|
|
|
@service router;
|
2023-02-17 13:25:51 +03:00
|
|
|
|
|
|
|
beforeModel() {
|
|
|
|
super.beforeModel(...arguments);
|
|
|
|
|
|
|
|
const user = this.session.user;
|
|
|
|
|
|
|
|
if (!user.isAdmin) {
|
2023-10-09 10:12:46 +03:00
|
|
|
return this.router.transitionTo('settings-x.settings-x', `staff/${user.slug}`);
|
2023-02-17 13:25:51 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|