Files
threshold-ui/ui/desktop/app/components/settings-card/user/index.js
T
Lisbet Alvarez 72f7c8a92d fix: 🐛 OIDC authentications not properly showing username (#2930)
* fix: 🐛 properly show username for oidc auth method in user menu

* test: 💍 fix admin ui tests

* test: 💍 fix desktop ui tests

* refactor: 💡 admin to not store username in authenticated object

* refactor: 💡 use getter in app controller

* test: 💍 POC for how we could update our tests to use auth account

* refactor: 💡 remove unused service

* test: 💍 fix all tests in ui/admin

* test: 💍 revert one change

* refactor: 💡 update ui/desktop w/ feedback + fix tests

* refactor: 💡 add in error handling

* refactor: 💡 cleanup unused service

* test: 💍 fix e2e test selector

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-17231
2025-10-30 12:49:30 -07:00

40 lines
847 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import Component from '@glimmer/component';
import { service } from '@ember/service';
export default class SettingsUserInfoComponent extends Component {
// =services
@service session;
@service intl;
// =attributes
/**
* Returns true if user is authenticated
* @type {boolean}
*/
get isAuthenticated() {
const { isAuthenticated } = this.session;
return isAuthenticated;
}
/**
* Returns the type of auth-method used by the user
* @type {string}
*/
get authMethod() {
const {
data: {
authenticated: { authenticator },
},
} = this.session;
const formattedAuthenticatorType = authenticator.split(':')[1];
return this.intl.t(`resources.account.types.${formattedAuthenticatorType}`);
}
}