Move every inline <script> block and on*= attribute out of the templates into per-page files under static/js/, then tighten the CSP to script-src 'self' so injected inline scripts are actually blocked. - static/js/base.js: QR modal, form[data-confirm] submit confirmation, and a shared glimmerCopy clipboard helper (loaded by base.html) - One script per template: index, bin_view, bin_token, admin, admin_edit, admin_bin, admin_bin_edit, admin_uploads - Template data now flows through data-* attributes (data-slug, data-filename, data-max-mb, ...) instead of being interpolated into JS; confirm() prompts use data-confirm - style-src keeps unsafe-inline for the style="" attributes - Update CLAUDE.md / AGENTS.md with the no-inline-JS rule Verified in a live browser session: shorten flow, login, QR modal, paste editor (token radios, name preview), paste cards (preview dialog, expand/close), public paste view, token prompt redirect, and uploads page - no console errors or CSP violations. Co-Authored-By: Claude Fable 5 <[email protected]>
27 lines
1.1 KiB
HTML
27 lines
1.1 KiB
HTML
{{define "title"}}Access Token Required — Glimmer{{end}}
|
|
{{define "content"}}
|
|
<div style="max-width: 480px; margin: 4rem auto 0;">
|
|
|
|
<div class="card" style="text-align: center; padding: 2.5rem 2rem;">
|
|
<div style="font-size: 3.5rem; line-height: 1; margin-bottom: 0.5rem;">🔒</div>
|
|
<h2 style="font-size: 1.5rem;">Access Token Required</h2>
|
|
<p class="text-muted" style="margin-bottom: 1.5rem;">This paste is protected. Enter the access token to view it.</p>
|
|
|
|
{{if .Error}}
|
|
<div class="alert alert-error" style="text-align: left;">{{.Error}}</div>
|
|
{{end}}
|
|
|
|
<form id="token-form" style="text-align: left;">
|
|
<div class="form-group">
|
|
<label for="token-input" class="form-label">Token</label>
|
|
<input type="text" id="token-input" placeholder="Enter access token" required autofocus>
|
|
</div>
|
|
<button type="submit" class="btn btn-primary btn-lg btn-block">View Paste</button>
|
|
</form>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<script src="/static/js/bin_token.js"></script>
|
|
{{end}}
|