Files
threshold-ui/ui/desktop/app/routes/scopes/scope/index.js
T
Susmitha Girumala 68107589bb refactor: Scope service into core addon and desktop routes
Ensure top-level scopes route within ui/admin and ui/desktop are exactly
the same in preparation for future refactor.

feat: Add projects/targets route

chore: yarn:format output in ui/desktop

test: Add basic acceptance tests for projects and targets
2020-11-23 16:22:34 -05:00

24 lines
577 B
JavaScript

import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
export default class ScopesScopeIndexRoute extends Route {
// =services
@service session;
// =methods
/**
* Redirects to scopes/scope/authenticate for further processing.
* If already authenticated, redirects to scopes/scope/scopes to display
* list of sub scopes.
*/
redirect() {
if (!this.session.isAuthenticated) {
this.replaceWith('scopes.scope.authenticate');
} else {
this.replaceWith('scopes.scope.projects.targets');
}
}
}