Open Vaibhav-nk-git opened 6 months ago
@Vaibhav-nk-git, Please, take a look at this video. This is how it was working for me the last time I checked. No new changes have been made.
Anyway, I'll take a look whenever I get the chance. Big thanks for notifying me. Would you like to checkout my other latest projects?
P.S. The api/webhook
is already being considered as the public route. So that might not be the root of this issue.
after successful payement for the pro plan its redirecting to /settings and there is no plan update
this is what im getting
INFO: Clerk: The request to /webhook is being protected (401) because there is no signed-in user, and the path is included in
apiRoutes
. To prevent this behavior, choose one of:apiRoutes
array passed to authMiddlewarepublicRoutes
array passed to authMiddlewareignoredRoutes: ["/((?!api|trpc))(_next.*|.+\.[\w]+$)", "/webhook"]
to authMiddlewareafterAuth
to authMiddleware, and replace Clerk's default behavior of redirecting unless a route is included in publicRoutesFor additional information about middleware, please visit https://clerk.com/docs/nextjs/middleware (This log only appears in development mode, or if
debug: true
is passed to authMiddleware)And my gpt says
It looks like you're receiving multiple log messages indicating that the request to "/webhook" is being protected (401) because there is no signed-in user, and the path is included in apiRoutes. This typically indicates an issue with authentication middleware configuration, specifically with Clerk authentication.
Here are some possible solutions based on the provided log messages:
Remove "/webhook" from apiRoutes: If you don't want the "/webhook" route to be protected by Clerk authentication, you can remove it from the apiRoutes array passed to the authMiddleware. Add "/webhook" to publicRoutes: If you want the "/webhook" route to be accessible to both signed-in and signed-out users, you can add it to the publicRoutes array passed to the authMiddleware. Ignore "/webhook" route for authentication: If you want to prevent Clerk authentication from running at all for the "/webhook" route, you can pass ignoredRoutes: ["/webhook"] to the authMiddleware configuration. Customize afterAuth behavior: You can pass a custom afterAuth function to the authMiddleware and replace Clerk's default behavior of redirecting unless a route is included in publicRoutes. Choose the solution that best fits your authentication requirements and modify your middleware configuration accordingly. Make sure to test your changes to ensure that the authentication behavior is as expected.