-
Notifications
You must be signed in to change notification settings - Fork 4
OAuth Setup for local development
Rajat Kulkarni edited this page May 8, 2025
·
6 revisions
This guide walks you through setting up Google OAuth for local development in a project that uses Vue 3 with Vite on the frontend and Node.js on the backend.
Create a .env file at the root of your project (same level as vite.config.js) and add:
VITE_GOOGLE_APP_CLIENT_ID=265xxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com
JWT_SECRET=xxxxxxxxx- Replace the
xxxxxxxx...part with your actual Google OAuth Client ID. -
JWT_SECRETis used for signing backend-generated JWTs. Keep it safe. (Get it online )
✅ Make sure
.envis included in.gitignore.
-
Navigate to APIs & Services > Credentials
-
Click Create Credentials → OAuth Client ID
-
Select Web application
-
Under Authorized JavaScript origins, add authorized URIs
-
Under Authorized redirect URIs match the redirect URL you handle in your app.
-
Click Create. Copy the Client ID and paste it into your
.envfile.
- Restart
vercel devafter editing.env. - Make sure your CORS settings allow
localhost:3000on the backend. - Don’t forget to secure your API endpoints.
- Introduction
- For Everyone
- For Developers
- For Designers
- For Management
- Introduction
- For Everyone
- For Developers
- For Designers
- For Management
- Banner
- Other Reusable Components (to be added)
- Introduction
- For Everyone
- For Developers
- For Designers
- For Management
- Resources for a New Developer
- Resources for a New Designer
- Resources for a New Project Manager