Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: API handler warning #248

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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());
DanielRivers marked this conversation as resolved.
Show resolved Hide resolved
};
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());
};