Nutlope / roomGPT

Upload a photo of your room to generate your dream room with AI.
https://www.roomgpt.io/
MIT License
10.01k stars 1.35k forks source link

Add auth with next-auth and Neon #27

Closed Nutlope closed 1 year ago

Nutlope commented 1 year ago

Add auth

This PR adds authentication to this app and makes it required to Login with Google to use the application. Users will get the ability to restore 5 photos per day.

We use next-auth to do the auth, then prisma + Neon to store user accounts. We're also now doing rate limiting by email.

Auth setup

  1. Use openssl rand -base64 32 to generate NEXTAUTH_SECRET
  2. Add DB URL and SHADOW DB URL from Neon
  3. Create a new project in console.cloud.google.com
  4. Click configure consent screen in API credentials page and click external
  5. Add an app name, do not upload logo, add authorized domain
  6. Publish app
  7. Create credentials -> Oauth client ID
  8. Run npx prisma db push && prisma migrate dev && prisma generate
vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
room-gpt ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 10, 2023 at 2:01AM (UTC)