edgedb / nextjs-edgedb-auth-template

A minimal starter designed to help you get up and running with EdgeDB and Next.js quickly. It includes a basic setup for authentication, EdgeDB schema, and a UI to get you started.
https://nextjs-edgedb-auth-template-kappa.vercel.app
32 stars 8 forks source link

Running dev server against Cloud is broken #18

Open elprans opened 1 month ago

elprans commented 1 month ago

pnpm dev seems to force NODE_ENV=development (at least the app ignores .env), and so the EdgeDB client ends up with tlsSecurity=insecure, which does not work with Cloud. Not sure if it's a template issue or an edgedb-js issue, but dev flows should work with Cloud out of the box.

beerose commented 1 month ago

Yeah, it's next that forces NODE_ENV to be development when running dev server (relevant code).

@scotttrinh, should we skip the insecure setting in the EdgeDB client setup?

elprans commented 1 month ago

The insecure setting should NOT actually drop HTTPS altogether. Instead, it should be ignoring TLS errors. The only place where not doing HTTPS makes sense is in frontend code where the browser will get in the way of insecure requests. Backend should always attempt to do HTTPS.