* [COMPLIANCE] Add Copyright and License Headers * chore: 🤖 update Copyright headers to satisfy our lint rules --------- Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> Co-authored-by: Cameron Perera <cameron.perera@hashicorp.com>
32 lines
706 B
JavaScript
32 lines
706 B
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
*/
|
|
|
|
import Route from '@ember/routing/route';
|
|
import { inject as service } from '@ember/service';
|
|
|
|
export default class ScopesScopeAuthenticateIndexRoute extends Route {
|
|
// =services
|
|
|
|
@service router;
|
|
|
|
// =methods
|
|
|
|
/**
|
|
* This index route exists solely to redirect the user on to the
|
|
* first auth method.
|
|
* @param {object} model
|
|
* @param {[AuthMethodModel]} model.authMethods
|
|
*/
|
|
redirect({ authMethods }) {
|
|
const firstAuthMethod = authMethods.firstObject;
|
|
if (firstAuthMethod) {
|
|
this.router.transitionTo(
|
|
'scopes.scope.authenticate.method',
|
|
firstAuthMethod
|
|
);
|
|
}
|
|
}
|
|
}
|