mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-18 14:56:37 +00:00
Remove keep logged in query string after login, dont show on select_mfa_module step (#10439)
This commit is contained in:
parent
7cadaf1dc3
commit
bb734be4bc
@ -206,7 +206,8 @@ 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 === genClientId() && step.step_id !== "mfa"
|
${this.clientId === genClientId() &&
|
||||||
|
!["select_mfa_module", "mfa"].includes(step.step_id)
|
||||||
? html`
|
? html`
|
||||||
<ha-formfield
|
<ha-formfield
|
||||||
class="store-token"
|
class="store-token"
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { AuthData } from "home-assistant-js-websocket";
|
import { AuthData } from "home-assistant-js-websocket";
|
||||||
|
import { extractSearchParam } from "../url/search-params";
|
||||||
|
|
||||||
const storage = window.localStorage || {};
|
const storage = window.localStorage || {};
|
||||||
|
|
||||||
@ -31,10 +32,7 @@ export function askWrite() {
|
|||||||
export function saveTokens(tokens: AuthData | null) {
|
export function saveTokens(tokens: AuthData | null) {
|
||||||
tokenCache.tokens = tokens;
|
tokenCache.tokens = tokens;
|
||||||
|
|
||||||
if (
|
if (!tokenCache.writeEnabled && extractSearchParam("storeToken") === "true") {
|
||||||
!tokenCache.writeEnabled &&
|
|
||||||
new URLSearchParams(window.location.search).get("storeToken") === "true"
|
|
||||||
) {
|
|
||||||
tokenCache.writeEnabled = true;
|
tokenCache.writeEnabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,10 +60,12 @@ const connProm = async (auth) => {
|
|||||||
searchParams.delete("auth_callback");
|
searchParams.delete("auth_callback");
|
||||||
searchParams.delete("code");
|
searchParams.delete("code");
|
||||||
searchParams.delete("state");
|
searchParams.delete("state");
|
||||||
|
searchParams.delete("storeToken");
|
||||||
|
const search = searchParams.toString();
|
||||||
history.replaceState(
|
history.replaceState(
|
||||||
null,
|
null,
|
||||||
"",
|
"",
|
||||||
`${location.pathname}?${searchParams.toString()}`
|
`${location.pathname}${search ? `?${search}` : ""}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user