fix: redirect vulnerability on error, sign in and totp page
This commit is contained in:
7
frontend/src/utils/router.util.ts
Normal file
7
frontend/src/utils/router.util.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export function safeRedirectPath(path: string | undefined) {
|
||||
if (!path) return "/";
|
||||
|
||||
if (!path.startsWith("/")) return `/${path}`;
|
||||
|
||||
return path;
|
||||
}
|
||||
Reference in New Issue
Block a user