Skip to content

Commit

Permalink
fix: API handler warning
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRivers committed Nov 27, 2024
1 parent 9c99f2f commit 2031ea3
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/handlers/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ const appRouterHandler = async (req, res, options) => {
if (route) {
const routerClient = new AppRouterClient(req, res, options);
await routerClient.createStore();
return await route(routerClient);
return void await route(routerClient);
} else {
return new Response('This page could not be found.', {status: 404});
return void new Response('This page could not be found.', {status: 404});
}
};

Expand All @@ -118,6 +118,6 @@ const pagesRouterHandler = async (req, res, clientOptions) => {
const route = getRoute(endpoint);
return route
? // @ts-ignore
await route(new PagesRouterClient(req, res, clientOptions))
: res.status(404).end();
void await route(new PagesRouterClient(req, res, clientOptions))
: void res.status(404).end();
};
8 changes: 4 additions & 4 deletions src/handlers/callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ export const callback = async (routerClient: RouterClient) => {
);
}

return routerClient.json({error: error.message}, {status: 500});
return void routerClient.json({error: error.message}, {status: 500});
}
if (postLoginRedirectURL) {
if (postLoginRedirectURL.startsWith('http')) {
return routerClient.redirect(postLoginRedirectURL);
return void routerClient.redirect(postLoginRedirectURL);
}
return routerClient.redirect(
return void routerClient.redirect(
`${routerClient.clientConfig.siteUrl}${postLoginRedirectURL}`
);
}

return routerClient.redirect(routerClient.clientConfig.siteUrl);
return void routerClient.redirect(routerClient.clientConfig.siteUrl);
};
2 changes: 1 addition & 1 deletion src/handlers/createOrg.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ export const createOrg = async (routerClient) => {
options
);

return routerClient.redirect(authUrl.toString());
return void routerClient.redirect(authUrl.toString());
};
2 changes: 1 addition & 1 deletion src/handlers/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ export const login = async (routerClient) => {
);
}

return routerClient.redirect(authUrl.toString());
return void routerClient.redirect(authUrl.toString());
};
2 changes: 1 addition & 1 deletion src/handlers/logout.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ export const logout = async (routerClient) => {
authUrl.searchParams.set('redirect', postLogoutRedirectURL);
}

return routerClient.redirect(authUrl.toString());
return void routerClient.redirect(authUrl.toString());
};
2 changes: 1 addition & 1 deletion src/handlers/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ export const register = async (routerClient) => {
);
}

return routerClient.redirect(authUrl.toString());
return void routerClient.redirect(authUrl.toString());
};

0 comments on commit 2031ea3

Please sign in to comment.