Files
threshold-ui/ui/admin/app/routes/scopes/scope/auth-methods.js
T

23 lines
501 B
JavaScript
Raw Normal View History

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
2020-08-12 15:43:34 -04:00
import Route from '@ember/routing/route';
2020-08-12 17:16:41 -04:00
import { inject as service } from '@ember/service';
2020-08-12 15:43:34 -04:00
export default class ScopesScopeAuthMethodsRoute extends Route {
2020-08-12 17:16:41 -04:00
// =services
@service session;
@service router;
2020-08-12 15:43:34 -04:00
// =methods
/**
* If arriving here unauthenticated, redirect to index for further processing.
*/
beforeModel() {
if (!this.session.isAuthenticated) this.router.transitionTo('index');
}
2020-08-12 15:43:34 -04:00
}