fix get resources after login
This commit is contained in:
1 parent
327f59104d
commit
9303a66aa8
9 files changed
+69
-12
No files matched your search
@@ -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 : '/'
|
||||
}
|
||||
Reference in new issue
Block a user