Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/client/pages/PasteViewPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -537,15 +537,18 @@ export default function PasteViewPage() {
const handleStatePatch = async (patch: { visibility?: PasteVisibility; ttl?: PasteTtlOption }) => {
if (!id || stateBusy || !canManageState) return;
const effectiveName = stateName.trim() || name.trim();
if (patch.ttl === 'permanent' && !effectiveName) {
if (patch.ttl === 'permanent' && !effectiveName && !isEncrypted) {
addNotification('Enter a name first before switching to Permanent.');
return;
}

setStateBusy(true);
try {
const payload: Record<string, unknown> = { ...patch };
if (stateName.trim() && stateName.trim() !== name.trim()) {
if (isEncrypted && patch.ttl === 'permanent') {
// Keep the decrypted title private inside the E2EE payload; send generic label for server perm validation.
payload.name = 'Encrypted paste';
} else if (stateName.trim() && stateName.trim() !== name.trim()) {
payload.name = stateName.trim();
}
const res = await fetch(`/api/paste/${encodeURIComponent(id)}`, {
Expand Down
4 changes: 3 additions & 1 deletion src/client/pages/SetupPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ export default function SetupPage() {
<>
<p style={{ margin: '0 0 12px', fontSize: 12, color: '#888', lineHeight: 1.5 }}>
{secret.totpOptional
? 'Optional · Scan this QR code to enable 2FA, or skip and finish activation.'
? preVerifiedPassword
? 'Email verified · Finish without 2FA below, or optionally scan this QR code to enable 2FA.'
: 'Optional · Scan this QR code to enable 2FA, or skip and finish activation.'
: 'Required for admins · Scan this QR code or enter the secret key, then type the 6-digit code.'}
</p>

Expand Down
Loading