Skip to content

Commit cf1906e

Browse files
Remove duplicate auth portal VNC password
1 parent adfc84c commit cf1906e

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

ax_browser_broker/api.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3725,12 +3725,6 @@ def _auth_portal_html(
37253725
"""
37263726
else:
37273727
safe_password = html.escape(str(vnc.get("password", "")))
3728-
inline_password_controls = f"""
3729-
<div class="request-row">
3730-
<span class="label">VNC password</span>
3731-
<span class="value"><span class="password-row password-row-inline"><code id="vncPasswordInline">{safe_password}</code><button class="button button-soft button-small copy-password" type="button">Copy</button></span></span>
3732-
</div>
3733-
"""
37343728
floating_auth = f"""
37353729
<aside class="auth-card is-warning is-minimized" id="authCard" aria-label="Human auth request">
37363730
<button class="auth-dismiss" type="button" id="minimizeAuth" aria-label="Minimize auth request">Hide</button>
@@ -4100,7 +4094,6 @@ def _auth_portal_html(
41004094
.auth-title {{ font-size: 18px; line-height: 1.2; font-weight: 760; }}
41014095
.auth-subtitle {{ margin-top: 5px; color: var(--muted); font-size: 14px; font-weight: 560; }}
41024096
.password-row {{ margin-top: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }}
4103-
.password-row-inline {{ margin-top: 0; }}
41044097
.auth-actions {{ margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }}
41054098
.auth-actions form, .auth-actions button, .auth-copy form, .auth-copy form button {{ width: 100%; }}
41064099
.auth-copy form {{ margin-top: 14px; }}
@@ -4258,7 +4251,7 @@ def _auth_portal_html(
42584251
}};
42594252
document.querySelectorAll('.copy-password').forEach((copyButton) => {{
42604253
copyButton.addEventListener('click', async () => {{
4261-
const passwordNode = copyButton.closest('.password-row')?.querySelector('code') || document.getElementById('vncPasswordInline') || document.getElementById('vncPassword');
4254+
const passwordNode = copyButton.closest('.password-row')?.querySelector('code') || document.getElementById('vncPassword');
42624255
const value = passwordNode ? passwordNode.textContent : '';
42634256
try {{
42644257
await navigator.clipboard.writeText(value);

tests/test_api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ def test_auth_portal_autostarts_and_embeds_password_for_trusted_ip(tmp_path, mon
150150
assert "Trusted connection" in response.text
151151
assert 'data-async-action="Auth handoff marked complete"' in response.text
152152
assert "Temporary VNC password" not in response.text
153+
assert "trust-pass" in response.text
153154

154155

155156
def test_auth_portal_keeps_password_prompt_for_untrusted_ip(tmp_path, monkeypatch) -> None:
@@ -183,6 +184,8 @@ def test_auth_portal_keeps_password_prompt_for_untrusted_ip(tmp_path, monkeypatc
183184
assert "Temporary VNC password" in response.text
184185
assert "enter it in the browser prompt" in response.text
185186
assert "manual-pass" in response.text
187+
assert response.text.count("manual-pass") == 1
188+
assert response.text.count("VNC password") == 1
186189
assert "#password=manual-pass" not in response.text
187190
assert 'id="authCard"' in response.text
188191
assert 'id="minimizeAuth"' in response.text

0 commit comments

Comments
 (0)