mirror of
https://github.com/Nezumi-2711/onedrive-vercel-index.git
synced 2026-09-22 13:38:45 +00:00
fix protected route could be empty
This commit is contained in:
+5
-1
@@ -44,9 +44,12 @@ export const useStaleSWR = (url: Key, path: string = '') => {
|
||||
}
|
||||
|
||||
export const matchProtectedRoute = (route: string) => {
|
||||
const protectedRoutes = siteConfig.protectedRoutes
|
||||
const protectedRoutes: string[] = siteConfig.protectedRoutes
|
||||
let authTokenPath = ''
|
||||
|
||||
for (const r of protectedRoutes) {
|
||||
// protected route array could be empty
|
||||
if (r) {
|
||||
if (
|
||||
route.startsWith(
|
||||
r
|
||||
@@ -59,5 +62,6 @@ export const matchProtectedRoute = (route: string) => {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
return authTokenPath
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user