mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Revert "Add a button to delete all refresh tokens" (#19480)
This commit is contained in:
parent
fffed0f5e1
commit
5c72c38c0d
@ -9,7 +9,6 @@ import "../../components/ha-card";
|
|||||||
import "../../components/ha-settings-row";
|
import "../../components/ha-settings-row";
|
||||||
import "../../components/ha-icon-button";
|
import "../../components/ha-icon-button";
|
||||||
import { RefreshToken } from "../../data/refresh_token";
|
import { RefreshToken } from "../../data/refresh_token";
|
||||||
import { deleteAllRefreshTokens } from "../../data/auth";
|
|
||||||
import {
|
import {
|
||||||
showAlertDialog,
|
showAlertDialog,
|
||||||
showConfirmationDialog,
|
showConfirmationDialog,
|
||||||
@ -109,13 +108,6 @@ class HaRefreshTokens extends LitElement {
|
|||||||
)
|
)
|
||||||
: ""}
|
: ""}
|
||||||
</div>
|
</div>
|
||||||
<div class="card-actions">
|
|
||||||
<mwc-button class="warning" @click=${this._deleteAllTokens}>
|
|
||||||
${this.hass.localize(
|
|
||||||
"ui.panel.profile.refresh_tokens.delete_all_tokens"
|
|
||||||
)}
|
|
||||||
</mwc-button>
|
|
||||||
</div>
|
|
||||||
</ha-card>`;
|
</ha-card>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,29 +139,6 @@ class HaRefreshTokens extends LitElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async _deleteAllTokens(): Promise<void> {
|
|
||||||
if (
|
|
||||||
!(await showConfirmationDialog(this, {
|
|
||||||
text: this.hass.localize(
|
|
||||||
"ui.panel.profile.refresh_tokens.confirm_delete_all"
|
|
||||||
),
|
|
||||||
destructive: true,
|
|
||||||
}))
|
|
||||||
) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
await deleteAllRefreshTokens(this.hass);
|
|
||||||
} catch (err: any) {
|
|
||||||
await showAlertDialog(this, {
|
|
||||||
title: this.hass.localize(
|
|
||||||
"ui.panel.profile.refresh_tokens.delete_failed"
|
|
||||||
),
|
|
||||||
text: err.message,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static get styles(): CSSResultGroup {
|
static get styles(): CSSResultGroup {
|
||||||
return [
|
return [
|
||||||
haStyle,
|
haStyle,
|
||||||
|
@ -5843,8 +5843,6 @@
|
|||||||
"last_used": "Last used {date} from {location}",
|
"last_used": "Last used {date} from {location}",
|
||||||
"not_used": "Has never been used",
|
"not_used": "Has never been used",
|
||||||
"confirm_delete": "Are you sure you want to delete the refresh token for {name}?",
|
"confirm_delete": "Are you sure you want to delete the refresh token for {name}?",
|
||||||
"delete_all_tokens": "Delete all tokens",
|
|
||||||
"confirm_delete_all": "Are you sure you want to delete all refresh tokens? You will be logged out as part of this operation.",
|
|
||||||
"delete_failed": "Failed to delete the refresh token.",
|
"delete_failed": "Failed to delete the refresh token.",
|
||||||
"current_token_tooltip": "Unable to delete current refresh token"
|
"current_token_tooltip": "Unable to delete current refresh token"
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user