mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 03:06:41 +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>
|
>Log out</paper-button>
|
||||||
</div>
|
</div>
|
||||||
</paper-card>
|
</paper-card>
|
||||||
|
<template is="dom-if" if="[[_canChangePassword(hass.user)]]">
|
||||||
<ha-change-password-card hass="[[hass]]"></ha-change-password-card>
|
<ha-change-password-card hass="[[hass]]"></ha-change-password-card>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</app-header-layout>
|
</app-header-layout>
|
||||||
`;
|
`;
|
||||||
@ -70,6 +72,10 @@ class HaPanelProfile extends EventsMixin(PolymerElement) {
|
|||||||
_handleLogOut() {
|
_handleLogOut() {
|
||||||
this.fire('hass-logout');
|
this.fire('hass-logout');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_canChangePassword(user) {
|
||||||
|
return user.credentials.some(cred => cred.auth_provider_type === 'homeassistant');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
customElements.define('ha-panel-profile', HaPanelProfile);
|
customElements.define('ha-panel-profile', HaPanelProfile);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user