Files
threshold-ui/ui/desktop/app/components/settings-card/user/index.hbs
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

47 lines
1.1 KiB
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: BUSL-1.1
}}
<SettingsCard @header={{t 'resources.user.title'}} @icon='user'>
<:state>
{{#if this.isAuthenticated}}
<Hds::Badge
@text={{t 'states.authenticated'}}
@icon='check'
@color='success'
/>
{{else}}
<Hds::Badge @text={{t 'states.unauthenticated'}} @color='neutral' />
{{/if}}
</:state>
<:body>
<div>
<Hds::Text::Display>
{{t 'resources.auth-method.title'}}
</Hds::Text::Display>
<Hds::Text::Body @tag='p' @weight='medium' data-test-auth-method>
{{this.authMethod}}
</Hds::Text::Body>
</div>
<div>
<Hds::Text::Display>
{{t 'form.username.label'}}
</Hds::Text::Display>
<Hds::Text::Body @tag='p' @weight='medium' data-test-username>
{{this.session.username}}
</Hds::Text::Body>
</div>
</:body>
<:action>
<Hds::Button
data-test-settings-signout-btn
@text={{t 'actions.deauthenticate'}}
@color='critical'
@icon='sign-out'
@size='medium'
{{on 'click' @onSignout}}
/>
</:action>
</SettingsCard>