Skip to content

Commit 97643a2

Browse files
Fotios Tsakiridisclaude
andcommitted
Add secure key to ticket live preview
- Preview iframe now includes ?key=SECRET for authentication - Open button uses secure URL - Display URL shows masked key (?key=***) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 29b5e15 commit 97643a2

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

web/templates/ticket_detail.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -656,13 +656,13 @@ <h1 style="font-size:0.95em">
656656
{% if ticket.preview_url %}
657657
<div class="tab-content" id="tab-preview" style="flex-direction:column">
658658
<div class="view-toggle">
659-
<label style="color:var(--text-muted)">{{ ticket.preview_url }}</label>
659+
<label style="color:var(--text-muted)">{{ ticket.preview_url }}?key=***</label>
660660
<label style="margin-left:auto;display:flex;align-items:center;gap:6px;cursor:pointer;font-size:12px;color:var(--text-secondary)">
661661
<input type="checkbox" id="auto-refresh-toggle" checked style="cursor:pointer">
662662
Auto-refresh (15s)
663663
</label>
664664
<button onclick="refreshPreview()" style="margin-left:12px;padding:6px 16px;background:var(--bg-card);border:1px solid var(--border-subtle);color:var(--text-primary);border-radius:6px;cursor:pointer;font-size:12px">Refresh</button>
665-
<button onclick="window.open('{{ ticket.preview_url }}', '_blank')" style="padding:6px 16px;background:var(--accent-cyan);border:none;color:#000;border-radius:6px;cursor:pointer;margin-left:8px;font-size:12px;font-weight:600">Open</button>
665+
<button onclick="window.open(previewUrl, '_blank')" style="padding:6px 16px;background:var(--accent-cyan);border:none;color:#000;border-radius:6px;cursor:pointer;margin-left:8px;font-size:12px;font-weight:600">Open</button>
666666
</div>
667667
<iframe id="preview-frame" src="" style="flex:1;border:none;background:#fff;width:100%"></iframe>
668668
</div>
@@ -1015,7 +1015,9 @@ <h3>Files</h3>
10151015
const ticketId = {{ ticket.id }};
10161016
const ticketStatus = '{{ ticket.status }}';
10171017
const projectId = {{ ticket.project_id }};
1018-
const previewUrl = '{{ ticket.preview_url|default("", true) }}';
1018+
const previewUrlBase = '{{ ticket.preview_url|default("", true) }}';
1019+
const secureKey = '{{ ticket.secure_key|default("", true) }}';
1020+
const previewUrl = previewUrlBase ? (previewUrlBase + (previewUrlBase.includes('?') ? '&' : '?') + 'key=' + secureKey) : '';
10191021
const isEmbed = {{ 'true' if embed else 'false' }};
10201022
let oldestMessageId = {% if messages and messages|length > 0 %}{{ messages[0].id }}{% else %}null{% endif %};
10211023
const totalMessages = {{ total_messages|default(0, true) }};

0 commit comments

Comments
 (0)