Refactor code and improve error handling in authentication methods
This commit contains several changes including the removal of an unused onClick event handler in remove-member-dialog.tsx. It also includes an update to the POST handler in the Webhook route of the database API where the authentication property has been updated. Lastly, it also brings improvements in error handling and logging in various areas, such as e2e authentication tests and the mailbox utility.
This commit is contained in:
@@ -5,17 +5,22 @@ import { enhanceRouteHandler } from '@kit/next/routes';
|
||||
* @name POST
|
||||
* @description POST handler for the webhook route that handles the webhook event
|
||||
*/
|
||||
export const POST = enhanceRouteHandler(async ({ request }) => {
|
||||
const service = getDatabaseWebhookHandlerService();
|
||||
export const POST = enhanceRouteHandler(
|
||||
async ({ request }) => {
|
||||
const service = getDatabaseWebhookHandlerService();
|
||||
|
||||
try {
|
||||
// handle the webhook event
|
||||
await service.handleWebhook(request);
|
||||
try {
|
||||
// handle the webhook event
|
||||
await service.handleWebhook(request);
|
||||
|
||||
// return a successful response
|
||||
return new Response(null, { status: 200 });
|
||||
} catch (error) {
|
||||
// return an error response
|
||||
return new Response(null, { status: 500 });
|
||||
}
|
||||
});
|
||||
// return a successful response
|
||||
return new Response(null, { status: 200 });
|
||||
} catch (error) {
|
||||
// return an error response
|
||||
return new Response(null, { status: 500 });
|
||||
}
|
||||
},
|
||||
{
|
||||
auth: false,
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user