Skip to content

Commit

Permalink
Merge pull request Azure#874 from Timothyw0/fix/873-start-crash-inclu…
Browse files Browse the repository at this point in the history
…ding-auth

fix (Azure#873, Azure#864): Start crash including auth & Node 20 support
  • Loading branch information
adrianhall authored Jul 24, 2024
2 parents c152eaa + 4963928 commit 4a481ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions schema/staticwebapp.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,7 @@
"node:14",
"node:16",
"node:18",
"node:20",
"python:3.8",
"python:3.9",
"python:3.10"
Expand Down
6 changes: 3 additions & 3 deletions src/msha/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ function getAuthPaths(isCustomAuth: boolean): Path[] {
route: /^\/\.auth\/purge\/(?<provider>aad|github|twitter|google|facebook|[a-z]+)(\?.*)?$/i,
// locally, all purge requests are processed as logout requests
function: "auth-logout",
}
},
);

return paths;
}

async function routeMatcher(
url = "/",
customAuth: SWAConfigFileAuth | undefined
customAuth: SWAConfigFileAuth | undefined,
): Promise<{ func: Function | undefined; bindingData: undefined | { provider: string } }> {
const authPaths = getAuthPaths(!!customAuth);
for (let index = 0; index < authPaths.length; index++) {
Expand All @@ -76,7 +76,7 @@ async function routeMatcher(
};
}

const func = (await import(`./routes/${path.function}`)).default as Function;
const func = (await import(`./routes/${path.function}.js`)).default as Function;
return { func, bindingData };
}
}
Expand Down

0 comments on commit 4a481ed

Please sign in to comment.