Projektarten: Login behaelt Ziel-Link, Hinweise im Ticket-Dialog
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c16049d266
commit
471c7a056d
5 files changed
+49
-7
No files matched your search
@@ -0,0 +1,8 @@
|
||||
// Rueckkehr-Ziel nach dem Login: nur relative Pfade dieser App (kein offener Redirect).
|
||||
export function safeReturnPath(from, fallback = '/tickets') {
|
||||
const path = typeof from === 'string' ? from : from?.pathname
|
||||
if (typeof path !== 'string' || !path.startsWith('/') || path.startsWith('//') || path.includes('\\')) return fallback
|
||||
if (path === '/login' || path.startsWith('/login/')) return fallback
|
||||
const search = typeof from === 'object' && typeof from?.search === 'string' && from.search.startsWith('?') ? from.search : ''
|
||||
return path + search
|
||||
}
|
||||
Reference in new issue
Block a user