awinogrodzki / next-firebase-auth-edge

Next.js Firebase Authentication for Edge and Node.js runtimes. Compatible with latest Next.js features.
https://next-firebase-auth-edge-docs.vercel.app/
MIT License
504 stars 43 forks source link

Help regarding minimal set up #267

Open FrugalX opened 3 days ago

FrugalX commented 3 days ago

I am trying to run the minimal example locally. However, I am encountering an error after going through the basic setup steps. Could you help me understand why this is happening.

error.

mitchelladams commented 3 days ago

Make sure you have a .env.local file in the project containing all the different configurations.

e.g.

AUTH_COOKIE_SIGNATURE_KEY_CURRENT="KEY-01"
AUTH_COOKIE_SIGNATURE_KEY_PREVIOUS="KEY-02"
FrugalX commented 2 days ago

i do have .env.local file. But i am not sure what all configurations will be needed. I went through the config.js file and saw the configuration they are using there. I am not sure where to get my AUTH_COOKIE_NAME, AUTH_COOKIE_SIGNATURE_KEY_CURRENT and AUTH_COOKIE_SIGNATURE_KEY_PREVIOUS

mitchelladams commented 2 days ago

See here: https://next-firebase-auth-edge-docs.vercel.app/docs/getting-started/middleware

The AUTH_COOKIE_NAME is just a string for what you want the cookie name to be.

The signature keys are at least 32 bit random strings. I use the Auth.js CLI to generate a random one in the terminal.

npx auth secret --raw