Deployed to Vercel - Getting 405s

Hey everyone :wave:

I’m having some difficulty debugging an error in my browser console when perform a query in my Redwood app. For example, if I try to login I’ll see a 405 error pop up in the console saying I don’t have permission to perform the request. Running locally, all good. On my Vercel deployment is where I’m having the issue.

Background details:

  • I’m using dbAuth
  • Running v0.38

I’ve got to be missing something here, but I’m not sure where to start. Any help would be awesome!

Hi @tundera Thanks for posting this. Could you add the link to your deployed app? Also, would it be possible to post the repo for your project if it’s public?

We introduced new config for the API endpoints in v0.38, one of which is specific to dbAuth. The defaults are supposed to work out of the box, but I wonder if it’s not working as expected. Here’s the Doc:

Looping in @dthyresson and @rob

Sure, no problem—

Here’s the repository on GitHub and a live production deployment on Vercel.

It’s a pretty simple setup, just a login to authenticate with dbAuth. The login and signup pages are the default ones created after running the dbAuth generator. There are private routes for /teams and /players that would become available after logging in or signing up. All the data is stored in a PostgreSQL database instance on Railway.

I’ll take a look through the link you posted and see if anything stands out that may be missing from my setup. Thanks for taking a look :pray:

1 Like

Apologies this took so long to get back to. Looks like the API endpoint was never configured for Vercel functions, thus the 502 (bad gateway).

I’ve made the change via PR on your repo:

Keep me posted!

1 Like

That did the trick! Everything works now as expected. Thanks so much for the feedback and help getting this one sorted out. Excited to try out some more features with the framework :smiley:

3 Likes

:metal:

Keep us posted! And have fun.

1 Like

I know it’s been a while, but is it possible to post the solution here? The repo with the PR isn’t up anymore.