From 2031ea38b6d9387d10d7d7457b7b3d63e0b435a4 Mon Sep 17 00:00:00 2001 From: Daniel Rivers Date: Wed, 27 Nov 2024 09:46:22 +0000 Subject: [PATCH] fix: API handler warning --- src/handlers/auth.js | 8 ++++---- src/handlers/callback.ts | 8 ++++---- src/handlers/createOrg.js | 2 +- src/handlers/login.js | 2 +- src/handlers/logout.js | 2 +- src/handlers/register.js | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/handlers/auth.js b/src/handlers/auth.js index 9ea79d01..a48d177e 100644 --- a/src/handlers/auth.js +++ b/src/handlers/auth.js @@ -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}); } }; @@ -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(); }; diff --git a/src/handlers/callback.ts b/src/handlers/callback.ts index 3cd5360c..d3fb98b3 100644 --- a/src/handlers/callback.ts +++ b/src/handlers/callback.ts @@ -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); }; diff --git a/src/handlers/createOrg.js b/src/handlers/createOrg.js index b146d5b1..45cc5c90 100644 --- a/src/handlers/createOrg.js +++ b/src/handlers/createOrg.js @@ -16,5 +16,5 @@ export const createOrg = async (routerClient) => { options ); - return routerClient.redirect(authUrl.toString()); + return void routerClient.redirect(authUrl.toString()); }; diff --git a/src/handlers/login.js b/src/handlers/login.js index 5496a30b..d5f76e92 100644 --- a/src/handlers/login.js +++ b/src/handlers/login.js @@ -23,5 +23,5 @@ export const login = async (routerClient) => { ); } - return routerClient.redirect(authUrl.toString()); + return void routerClient.redirect(authUrl.toString()); }; diff --git a/src/handlers/logout.js b/src/handlers/logout.js index 6191947e..05d3e1b3 100644 --- a/src/handlers/logout.js +++ b/src/handlers/logout.js @@ -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()); }; diff --git a/src/handlers/register.js b/src/handlers/register.js index 5f69d974..99cdf255 100644 --- a/src/handlers/register.js +++ b/src/handlers/register.js @@ -23,5 +23,5 @@ export const register = async (routerClient) => { ); } - return routerClient.redirect(authUrl.toString()); + return void routerClient.redirect(authUrl.toString()); };