fix: redirect vulnerability on error, sign in and totp page

This commit is contained in:
Elias Schneider
2024-04-05 12:00:41 +02:00
parent 9d1a12b0d1
commit 384fd19203
4 changed files with 20 additions and 8 deletions

View File

@@ -0,0 +1,7 @@
export function safeRedirectPath(path: string | undefined) {
if (!path) return "/";
if (!path.startsWith("/")) return `/${path}`;
return path;
}