fix get resources after login

This commit is contained in:
vadim committed 2026-10-21 12:56:57 +03:00
1 parent 327f59104d
commit 9303a66aa8
9 files changed
+69 -12

No files matched your search

+7
View File
@@ -0,0 +1,7 @@
import type { LocationQueryValue } from 'vue-router'
/** Path to return to after sign-in; only same-origin paths are accepted to avoid open redirects */
export function redirectTarget(redirect: LocationQueryValue | LocationQueryValue[] | undefined): string {
const value = Array.isArray(redirect) ? redirect[0] : redirect
return value && value.startsWith('/') && !value.startsWith('//') ? value : '/'
}