Following methodology in your book, everything running great, woke up this morning and now I can’t login locally - getting a 405 error because Nuxt is trying to run a “GET Method” instead of Post…
And it looks like some Chrome update (it works fine in Firefox)…
Do you have any information on how you setup your local environment? I could never figure out how to run Nuxt through https - and I’m pretty sure this is the error I’m getting this morning.
I can easily switch the API server with valet, but with Nuxt, I could never get it to run https.
UPDATE: got it to start working again by disabling web security which is less than ideal, but gets me past the original roadblock for now
That’s super bizarre that it just switched to GET. The method is set in your nuxt.config.js file but if you are using Laravel Sanctum with the laravelSanctum auth strategy, it should automatically POST to the /login route.
With the multiple requests to the /login route and /csrf-cookie route, I assume 1 is the OPTIONS request and the other is the actual request. However, I don’t know why there are 3. Are you by any chance hooking into the method to submit the log in form multiple times? Like 2 event handlers? Just throwing out some possible ideas.
As for running NuxtJS locally with HTTPS, we did get it working. However, we have a Docker development environment that @jaydrogers set up custom. He can guide a little more on the HTTPS side of things, I know it was kind of a trick.
Basically what we do is run a custom certificate on the docker container that is proxied to Traefik (which handles the edge certificates automatically for us with Let’s Encrypt)
This way the entire connection is terminated over SSL using a free signed certificate.
Let me know if you have any questions. I hope this helps!
Made my own, didn’t work. Grabbed yours and put them in the root of the app, added those keys into nuxt.config.js, ran yarn dev and it says it’s listening on https://localhost:3000 but going there, I get “Connection is not private NET::ERR_CERT_AUTHORITY_INVALID”