Files
threshold-ui/ui/admin/app/routes/scopes/scope/authenticate/index.js
T
Zhihe Li bcf004b8a4 Reformat codebase with trailing commas in functions (#2006)
* style: 💄 Update trailing commas in API

* style: 💄 Update trailing commas in core

* style: 💄 Update trailing commas in rose

* style: 💄 Update trailing commas in admin

* style: 💄 Update trailing commas in desktop
2023-11-22 14:07:41 -05:00

32 lines
698 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[0];
if (firstAuthMethod) {
this.router.transitionTo(
'scopes.scope.authenticate.method',
firstAuthMethod,
);
}
}
}