mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Hide change password card for non-homeassistant auth_providers. (#1526)
This commit is contained in:
parent
fdbaa3908a
commit
be7fb50f8c
@ -53,7 +53,9 @@ class HaPanelProfile extends EventsMixin(PolymerElement) {
|
||||
>Log out</paper-button>
|
||||
</div>
|
||||
</paper-card>
|
||||
<ha-change-password-card hass="[[hass]]"></ha-change-password-card>
|
||||
<template is="dom-if" if="[[_canChangePassword(hass.user)]]">
|
||||
<ha-change-password-card hass="[[hass]]"></ha-change-password-card>
|
||||
</template>
|
||||
</div>
|
||||
</app-header-layout>
|
||||
`;
|
||||
@ -70,6 +72,10 @@ class HaPanelProfile extends EventsMixin(PolymerElement) {
|
||||
_handleLogOut() {
|
||||
this.fire('hass-logout');
|
||||
}
|
||||
|
||||
_canChangePassword(user) {
|
||||
return user.credentials.some(cred => cred.auth_provider_type === 'homeassistant');
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define('ha-panel-profile', HaPanelProfile);
|
||||
|
Loading…
x
Reference in New Issue
Block a user