beeeeg update
Some checks failed
Test and deploy staging / staging (push) Has been cancelled

This commit is contained in:
2026-09-23 04:15:10 +00:00
parent 487eff5bb2
commit d0c7b6548b
135 changed files with 9531 additions and 1777 deletions

13
src/lib/auth-redirect.ts Normal file
View File

@@ -0,0 +1,13 @@
export function safeReturnTo(value: string | null): string {
if (!value || !value.startsWith('/') || value.startsWith('//') || /[\\\s]/.test(value)) {
return '/account';
}
const url = new URL(value, 'https://local.invalid');
if (
url.origin !== 'https://local.invalid' ||
/^\/(api\/auth|login|register|logout)(\/|$)/.test(url.pathname)
) {
return '/account';
}
return url.pathname + url.search + url.hash;
}