2023-03-01 09:39:41 -06:00
|
|
|
/**
|
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
2024-05-31 11:29:24 -07:00
|
|
|
* SPDX-License-Identifier: BUSL-1.1
|
2023-03-01 09:39:41 -06:00
|
|
|
*/
|
|
|
|
|
|
2020-08-17 14:56:19 -04:00
|
|
|
import Controller from '@ember/controller';
|
2025-04-18 12:42:18 -07:00
|
|
|
import { service } from '@ember/service';
|
2020-08-17 14:56:19 -04:00
|
|
|
|
|
|
|
|
export default class ScopesScopeAuthenticateController extends Controller {
|
2025-04-18 12:42:18 -07:00
|
|
|
@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}
|
|
|
|
|
*/
|
2022-07-18 09:08:09 -07:00
|
|
|
|
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
|
|
|
}
|
2025-04-18 12:42:18 -07: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
|
|
|
}
|