Wechsel Ticketsystem → Projekt-Admin per Einmal-Link, Rückweg-Button

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-09-30 10:31:10 +00:00
1 parent 9b14a74fcc
commit 0555a2274d
7 files changed
+164 -1

No files matched your search

+6 -1
View File
@@ -20,11 +20,16 @@ export function createStaffPreviewToken(payload) {
return token
}
export function consumeStaffPreviewToken(token) {
/**
* Einmal einloesen. purpose trennt Preview-Links ('preview', Standard) vom Wechsel ins Projekt-Admin
* ('switch'); ein Token fuer den falschen Zweck ist trotzdem verbraucht.
*/
export function consumeStaffPreviewToken(token, purpose = 'preview') {
purgeExpired()
const entry = tokens.get(token)
if (!entry) return null
tokens.delete(token)
if (entry.expiresAt <= Date.now()) return null
if ((entry.purpose || 'preview') !== purpose) return null
return entry
}