Is it possible to call an async functions inside the callback of clerkMiddleware?
Unanswered
Bald Eagle posted this in #help-forum
Bald EagleOP
The following setup does not throw any errors, but the async function is not executed correctly because
I feel like this should be possible because NextJS allows for async middleware.
undefined is always returned. Is it possible to call an async functions inside the callback of clerkMiddleware?I feel like this should be possible because NextJS allows for async middleware.
export default clerkMiddleware(async(auth, request) => {
if (isProtectedRoute(request)) { auth().protect(); }
await someAsyncFunction();
});