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:
1 parent
9b14a74fcc
commit
0555a2274d
7 files changed
+164
-1
No files matched your search
@@ -335,6 +335,19 @@ router.get('/staff-preview', async (req, res) => {
|
||||
return res.redirect(previewUrl)
|
||||
})
|
||||
|
||||
// Wechsel aus dem Ticketsystem (POST /api/admin/switch-link): Einmal-Link -> Admin-Sitzung
|
||||
router.get('/staff-switch', async (req, res) => {
|
||||
const tokenData = consumeStaffPreviewToken(String(req.query.token || ''), 'switch')
|
||||
if (!tokenData) {
|
||||
return res.redirect(`/login.html?error=${encodeURIComponent('Link abgelaufen, bitte anmelden')}`)
|
||||
}
|
||||
await startStaffPortalSession(res, {
|
||||
userId: tokenData.userId,
|
||||
staff: { isAdmin: Boolean(tokenData.isAdmin), name: tokenData.name, email: tokenData.email },
|
||||
})
|
||||
return res.redirect('/admin.html')
|
||||
})
|
||||
|
||||
// Selbstheilung: Portal-Session lebt oft laenger als das preview_session-Cookie
|
||||
// (bzw. das Cookie fehlt nach WebView-/Browser-Datenverlust). Ohne gueltiges
|
||||
// Preview-Cookie laufen die *.project.webklar.com-Hosts in eine 302-Schleife.
|
||||
|
||||
Reference in new issue
Block a user