Files
threshold-ui/ui/admin/app/controllers/scopes/scope/authenticate.js
T

36 lines
796 B
JavaScript
Raw Normal View History

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
2020-08-17 14:56:19 -04:00
import Controller from '@ember/controller';
import { service } from '@ember/service';
2020-08-17 14:56:19 -04:00
export default class ScopesScopeAuthenticateController extends Controller {
@service router;
2020-08-17 14:56:19 -04:00
// =attributes
/**
2020-10-03 12:43:12 -04:00
* Moves the global scope to index 0.
2020-08-17 14:56:19 -04:00
* @type {Array}
*/
2020-10-03 12:43:12 -04:00
get sortedScopes() {
return [
...this.model.scopes.filter((scope) => scope.id === 'global'),
...this.model.scopes.filter((scope) => scope.id !== 'global'),
2020-11-16 15:08:59 -05:00
];
2020-10-03 12:43:12 -04:00
}
/**
* Checks if the current route is the OIDC method authentication route.
* @type {boolean}
* @returns {boolean}
*/
get isOIDCRoute() {
return (
this.router.currentRouteName === 'scopes.scope.authenticate.method.oidc'
);
}
2020-08-17 14:56:19 -04:00
}