mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-17 14:26:35 +00:00
Show error message if login is blocked (#11331)
This commit is contained in:
parent
effec839af
commit
9fffc93e5d
@ -162,6 +162,11 @@ class HaAuthFlow extends litLocalizeLiteMixin(LitElement) {
|
|||||||
this._errorMessage
|
this._errorMessage
|
||||||
)}
|
)}
|
||||||
</ha-alert>
|
</ha-alert>
|
||||||
|
<div class="action">
|
||||||
|
<mwc-button raised @click=${this._startOver}>
|
||||||
|
${this.localize("ui.panel.page-authorize.form.start_over")}
|
||||||
|
</mwc-button>
|
||||||
|
</div>
|
||||||
`;
|
`;
|
||||||
case "loading":
|
case "loading":
|
||||||
return html`
|
return html`
|
||||||
@ -339,6 +344,10 @@ class HaAuthFlow extends litLocalizeLiteMixin(LitElement) {
|
|||||||
return this.localize("ui.panel.page-authorize.form.unknown_error");
|
return this.localize("ui.panel.page-authorize.form.unknown_error");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _startOver() {
|
||||||
|
this._providerChanged(this.authProvider);
|
||||||
|
}
|
||||||
|
|
||||||
private async _handleSubmit(ev: Event) {
|
private async _handleSubmit(ev: Event) {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
if (this._step == null) {
|
if (this._step == null) {
|
||||||
@ -361,6 +370,12 @@ class HaAuthFlow extends litLocalizeLiteMixin(LitElement) {
|
|||||||
|
|
||||||
const newStep = await response.json();
|
const newStep = await response.json();
|
||||||
|
|
||||||
|
if (response.status === 403) {
|
||||||
|
this._state = "error";
|
||||||
|
this._errorMessage = newStep.message;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (newStep.type === "create_entry") {
|
if (newStep.type === "create_entry") {
|
||||||
this._redirect(newStep.result);
|
this._redirect(newStep.result);
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user