Skip to content

Commit

Permalink
fix protectedRoutes type error, close spencerwooo#736
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerwooo committed Aug 4, 2022
1 parent 99d1a1e commit 250b5e6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pages/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ export function getAuthTokenPath(path: string) {
// Ensure trailing slashes to compare paths component by component. Same for protectedRoutes.
// Since OneDrive ignores case, lower case before comparing. Same for protectedRoutes.
path = path.toLowerCase() + '/'
const protectedRoutes = siteConfig.protectedRoutes
const protectedRoutes = siteConfig.protectedRoutes as string[]
let authTokenPath = ''
for (let r of protectedRoutes) {
if (typeof r !== 'string') continue
r = r.toLowerCase().replace(/\/$/, '') + '/'
if (path.startsWith(r)) {
authTokenPath = `${r}.password`
Expand Down

0 comments on commit 250b5e6

Please sign in to comment.