Match clientID origin

This commit is contained in:
Ludeeus 2021-10-27 07:44:47 +00:00
parent da38e6f986
commit 2a8a5319a2

View File

@ -174,6 +174,9 @@ class HaAuthFlow extends litLocalizeLiteMixin(LitElement) {
} }
private _renderStep(step: DataEntryFlowStep): TemplateResult { private _renderStep(step: DataEntryFlowStep): TemplateResult {
const clientIdOrigin = this.clientId
? new URL(this.clientId).origin
: undefined;
switch (step.type) { switch (step.type) {
case "abort": case "abort":
return html` return html`
@ -205,7 +208,7 @@ class HaAuthFlow extends litLocalizeLiteMixin(LitElement) {
.computeError=${this._computeErrorCallback(step)} .computeError=${this._computeErrorCallback(step)}
@value-changed=${this._stepDataChanged} @value-changed=${this._stepDataChanged}
></ha-form> ></ha-form>
${this.clientId === window.location.origin && step.step_id !== "mfa" ${clientIdOrigin === window.location.origin && step.step_id !== "mfa"
? html` ? html`
<ha-formfield <ha-formfield
class="store-token" class="store-token"