Skip to content

Commit ae170d7

Browse files
feat: add support for purging auth info (#187)
* fix nmp start command * fix: add support for purging auth info fixes #108
1 parent 16c4f35 commit ae170d7

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

src/auth/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ const authPaths: Path[] = [
1717
route: /^\/\.auth\/logout/,
1818
function: "auth_logout",
1919
},
20+
{
21+
method: "GET",
22+
route: /^\/\.auth\/purge\/(?<provider>aad|github|twitter|google|facebook|[a-z]+)/,
23+
function: "auth_logout",
24+
},
2025
];
2126

2227
async function routeMatcher(url = "/"): Promise<{ func: Function | undefined; bindingData: undefined | { provider: string } }> {

src/cli/commands/start.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export async function start(startContext: string, options: SWACLIConfig) {
7979
const funcBinary = "func";
8080
// serve the api if and only if the user provides a folder via the --api-location flag
8181
if (isApiLocationExistsOnDisk) {
82-
serveApiCommand = `cd ${userConfig.apiLocation} && ${funcBinary} start --cors "*" --port ${options.apiPort}`;
82+
serveApiCommand = `cd "${userConfig.apiLocation}" && ${funcBinary} start --cors "*" --port ${options.apiPort}`;
8383
}
8484
}
8585
}
@@ -121,7 +121,7 @@ export async function start(startContext: string, options: SWACLIConfig) {
121121
const { env } = process;
122122
const concurrentlyCommands: concurrently.CommandObj[] = [
123123
// start the reverse proxy
124-
{ command: `node ${path.join(__dirname, "..", "..", "proxy", "server.js")}`, name: "swa", env, prefixColor: "gray.dim" },
124+
{ command: `node "${path.join(__dirname, "..", "..", "proxy", "server.js")}"`, name: "swa", env, prefixColor: "gray.dim" },
125125
];
126126

127127
if (isApiLocationExistsOnDisk) {
@@ -134,7 +134,7 @@ export async function start(startContext: string, options: SWACLIConfig) {
134134
if (startupCommand) {
135135
concurrentlyCommands.push(
136136
// run an external script, if it's available
137-
{ command: `cd ${userConfig?.appLocation} && ${startupCommand}`, name: "run", env, prefixColor: "gray.dim" }
137+
{ command: `cd "${userConfig?.appLocation}" && ${startupCommand}`, name: "run", env, prefixColor: "gray.dim" }
138138
);
139139
}
140140

0 commit comments

Comments
 (0)