diff --git a/src/auth/ha-local-auth-flow.ts b/src/auth/ha-local-auth-flow.ts index c1f601ffcf..6068213d68 100644 --- a/src/auth/ha-local-auth-flow.ts +++ b/src/auth/ha-local-auth-flow.ts @@ -17,7 +17,7 @@ import { submitLoginFlow, } from "../data/auth"; import { DataEntryFlowStep } from "../data/data_entry_flow"; -import { listPersons } from "../data/person"; +import { BasePerson, listUserPersons } from "../data/person"; import "./ha-auth-textfield"; import type { HaAuthTextField } from "./ha-auth-textfield"; @@ -43,7 +43,7 @@ export class HaLocalAuthFlow extends LitElement { @state() private _submitting = false; - @state() private _persons?: Promise>; + @state() private _persons?: Record; @state() private _selectedUser?: string; @@ -65,7 +65,9 @@ export class HaLocalAuthFlow extends LitElement { if (!this.authProvider?.users || !this._persons) { return nothing; } - const userIds = Object.keys(this.authProvider.users); + const userIds = Object.keys(this.authProvider.users).filter( + (userId) => userId in this._persons! + ); return html`